1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

Add thread-id to log format

This commit is contained in:
Ross McFarland
2017-03-27 15:27:34 -07:00
parent 377bda4f9c
commit ffa42d4015

View File

@@ -43,9 +43,7 @@ class ArgumentParser(_Base):
return args
def _setup_logging(self, args, default_log_level):
# TODO: if/when things are multi-threaded add [%(thread)d] in to the
# format
fmt = '%(asctime)s %(levelname)-5s %(name)s %(message)s'
fmt = '%(asctime)s [%(thread)d] %(levelname)-5s %(name)s %(message)s'
formatter = Formatter(fmt=fmt, datefmt='%Y-%m-%dT%H:%M:%S ')
stream = stdout if args.log_stream_stdout else stderr
handler = StreamHandler(stream=stream)