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]
|
[formatter_simple]
|
||||||
# Simple output format
|
# Simple output format
|
||||||
format = %(message)s
|
format = [%(thread)x] %(levelname)s: %(message)s
|
||||||
|
|
||||||
[formatter_full]
|
[formatter_full]
|
||||||
# Full output format
|
# 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." %
|
"Logging configuration file '%s' not found, using stderr." %
|
||||||
filename)
|
filename)
|
||||||
handler = logging.StreamHandler(sys.stderr)
|
handler = logging.StreamHandler(sys.stderr)
|
||||||
handler.setFormatter(logging.Formatter("%(message)s"))
|
handler.setFormatter(
|
||||||
|
logging.Formatter("[%(thread)x] %(levelname)s: %(message)s"))
|
||||||
logger.addHandler(handler)
|
logger.addHandler(handler)
|
||||||
if debug:
|
if debug:
|
||||||
logger.setLevel(logging.DEBUG)
|
logger.setLevel(logging.DEBUG)
|
||||||
|
Loading…
Reference in New Issue
Block a user