method to globally set logging to output nicely to the console

This will make all of the direct calls to logging level functions output
in a format that looks appropriate for the console. Previously, the default
output looked like it should be written to a log file.
This commit is contained in:
Hans-Christoph Steiner 2024-02-27 16:39:53 +01:00 committed by Michael Pöhn
parent 091fe9b260
commit 76d9eddb3a
5 changed files with 42 additions and 4 deletions

View file

@ -83,6 +83,8 @@ def main():
)
options = parser.parse_args()
common.set_console_logging(options.verbose)
fdroiddir = os.getcwd()
test_config = dict()
examplesdir = common.get_examples_dir()
@ -290,4 +292,9 @@ and https://f-droid.org/docs/Signing_Process'''
)
% os.path.join(fdroiddir, 'repo')
)
logging.info(msg)
if not options.quiet:
# normally, INFO is only shown with --verbose, but show this unless --quiet
logger = logging.getLogger()
logger.setLevel(logging.INFO)
logger.info(msg)
logging.shutdown()