mirror of
https://github.com/isjerryxiao/pacroller.git
synced 2024-12-23 22:59:24 +08:00
release v0.1.5
fix logging issue
This commit is contained in:
parent
6330ba1a06
commit
bc69d010e5
2 changed files with 6 additions and 5 deletions
2
setup.py
2
setup.py
|
@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|||
|
||||
setuptools.setup(
|
||||
name="pacroller",
|
||||
version="0.1.4",
|
||||
version="0.1.5",
|
||||
author="Jerry Xiao",
|
||||
author_email="pacroller@mail.jerryxiao.cc",
|
||||
description="unattended upgrade for archlinux",
|
||||
|
|
|
@ -272,10 +272,11 @@ def main() -> None:
|
|||
default='auto', help='allow interactive questions',
|
||||
metavar="auto / on / off ")
|
||||
args = parser.parse_args()
|
||||
if args.debug:
|
||||
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(module)s - %(funcName)s - %(levelname)s - %(message)s')
|
||||
else:
|
||||
logging.basicConfig(level=logging.INFO, format='%(levelname)s - %(message)s')
|
||||
_log_format = '%(asctime)s - %(module)s - %(funcName)s - %(levelname)s - %(message)s' if args.debug else '%(levelname)s - %(message)s'
|
||||
logging.basicConfig(level=logging.DEBUG, format=_log_format)
|
||||
if not args.debug:
|
||||
assert len(logger.handlers) == 1
|
||||
logger.handlers[0].setLevel(logging.INFO)
|
||||
locale_set()
|
||||
interactive = args.interactive == "on" or not (args.interactive == 'off' or not isatty(0))
|
||||
logger.debug(f"interactive questions {'enabled' if interactive else 'disabled'}")
|
||||
|
|
Loading…
Reference in a new issue