Merge pull request #510 from Unrud/log
Improve formatting of log messages
This commit is contained in:
commit
dc94a5a4b7
4
logging
4
logging
@ -53,8 +53,8 @@ formatter = full
|
||||
|
||||
[formatter_simple]
|
||||
# Simple output format
|
||||
format = %(message)s
|
||||
format = [%(thread)x] %(levelname)s: %(message)s
|
||||
|
||||
[formatter_full]
|
||||
# Full output format
|
||||
format = %(asctime)s - %(thread)d - %(levelname)s: %(message)s
|
||||
format = %(asctime)s - [%(thread)x] %(levelname)s: %(message)s
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user