From f4d0cff83d140e24a1cd439e2dcd5436755d0120 Mon Sep 17 00:00:00 2001 From: Jarkko Jaakola Date: Mon, 20 Dec 2021 12:03:06 +0200 Subject: [PATCH] Use root logger for Karapace startup info line printing The `print` function uses buffered `stdout` and it may get printed after shutdown. Use logger instead to print the startup line in correct place during startup. Alternative the `print' function could use argument `flush=True`. --- karapace/karapace_all.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/karapace/karapace_all.py b/karapace/karapace_all.py index e0ce5ce52..879fa59e3 100644 --- a/karapace/karapace_all.py +++ b/karapace/karapace_all.py @@ -43,7 +43,8 @@ def main() -> int: print("Both rest and registry options are disabled, exiting") return 1 - print("=" * 100 + f"\nStarting {info_str}\n" + "=" * 100) + info_str_separator = "=" * 100 + logging.log(logging.INFO, "\n%s\nStarting %s\n%s", info_str_separator, info_str, info_str_separator) try: kc.run(host=kc.config["host"], port=kc.config["port"])