Skip to content

Commit

Permalink
Use root logger for Karapace startup info line printing
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
jjaakola-aiven committed Dec 20, 2021
1 parent acc2c8a commit f4d0cff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion karapace/karapace_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down

0 comments on commit f4d0cff

Please sign in to comment.