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

@ -53,7 +53,7 @@ formatter = full
[formatter_simple]
# Simple output format
format = %(message)s
format = [%(thread)x] %(levelname)s: %(message)s
[formatter_full]
# Full output format

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)