Skip to content

Commit

Permalink
thread and level in simple log formatter
Browse files Browse the repository at this point in the history
The log messages are a mess without any allocation to threads.
  • Loading branch information
Unrud committed Sep 4, 2016
1 parent 26e58ce commit d371179
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion logging
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion radicale/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def handler(signum, frame):
"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)
Expand Down

0 comments on commit d371179

Please sign in to comment.