1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-06-26 16:45:52 +00:00

thread and level in simple log formatter

The log messages are a mess without any allocation to threads.
This commit is contained in:
Unrud 2016-09-03 10:19:29 +02:00
parent 26e58cee56
commit d371179487
2 changed files with 3 additions and 2 deletions

View file

@ -56,7 +56,8 @@ def start(name="radicale", filename=None, debug=False):
"Logging configuration file '%s' not found, using stderr." %
filename)
handler = logging.StreamHandler(sys.stderr)
handler.setFormatter(logging.Formatter("%(message)s"))
handler.setFormatter(
logging.Formatter("[%(thread)x] %(levelname)s: %(message)s"))
logger.addHandler(handler)
if debug:
logger.setLevel(logging.DEBUG)