From d28ba52084c276db319173885d81e5a550341cd2 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 27 Oct 2022 12:23:51 +0300 Subject: Declutter stdout * wqflask/utility/tools.py: Output extraneous messages to stderr rather than stdout to avoid cluttering the output. --- wqflask/utility/tools.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/wqflask/utility/tools.py b/wqflask/utility/tools.py index fe059015..636bf040 100644 --- a/wqflask/utility/tools.py +++ b/wqflask/utility/tools.py @@ -239,20 +239,24 @@ ENDC = '\033[0m' def show_settings(): from utility.tools import LOG_LEVEL - print(("Set global log level to " + BLUE + LOG_LEVEL + ENDC)) + print(("Set global log level to " + BLUE + LOG_LEVEL + ENDC), + file=sys.stderr) log_level = getattr(logging, LOG_LEVEL.upper()) logging.basicConfig(level=log_level) logger.info(OVERRIDES) logger.info(BLUE + "Mr. Mojo Risin 2" + ENDC) keylist = list(app.config.keys()) - print("runserver.py: ****** Webserver configuration - k,v pairs from app.config ******") + print("runserver.py: ****** Webserver configuration - k,v pairs from app.config ******", + file=sys.stderr) keylist.sort() for k in keylist: try: - print(("%s: %s%s%s%s" % (k, BLUE, BOLD, get_setting(k), ENDC))) + print(("%s: %s%s%s%s" % (k, BLUE, BOLD, get_setting(k), ENDC)), + file=sys.stderr) except: - print(("%s: %s%s%s%s" % (k, GREEN, BOLD, app.config[k], ENDC))) + print(("%s: %s%s%s%s" % (k, GREEN, BOLD, app.config[k], ENDC)), + file=sys.stderr) # Cached values -- cgit v1.2.3