Closed dkriegner closed 1 year ago
Info messages don't show in the terminal. After using logging.getLogger().setLevel(logging.INFO)
, all messages are red:
How to rewrite this:
I am not sure myself. Its possible that this can not be rewritten since a log entry is always a separate line
Info messages don't show in the terminal. After using
logging.getLogger().setLevel(logging.INFO)
, all messages are red:
I am pretty sure this is a particularity of your command line. usually info output is not red. Warnings/errors might be red. In my command line actually no logging output is red. There are lots of things which can be configured via the "handler" of the logger
I've just tried to open in the Windows terminal:
It doesn't look terrible.
I do not like much the INFO:root:
part. you can remove this as outlined for example here:
https://stackoverflow.com/questions/8353594/can-python-log-output-without-inforoot
It can be also useful to output there some timestamp instead. This is usually more helpful than the default output.
It works!
We could use https://docs.python.org/3/library/logging.html to allow for an easily adjustable degree of logging output. The user could via a command line argument set the level of verbosity they expect in the output.