mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-08 00:20:59 +00:00
Add thread name to log output when threads are enabled.
This commit is contained in:
parent
b8944e493a
commit
8d98337ffe
1 changed files with 5 additions and 1 deletions
|
|
@ -168,10 +168,14 @@ class Configuration (dict):
|
|||
logging.config.fileConfig(filename)
|
||||
if handler is None:
|
||||
handler = ansicolor.ColoredStreamHandler(strm=sys.stderr)
|
||||
handler.setFormatter(logging.Formatter("%(levelname)s %(message)s"))
|
||||
logging.getLogger(LOG_ROOT).addHandler(handler)
|
||||
self.set_debug(debug)
|
||||
self.status_logger = status_logger
|
||||
if self['threads'] > 0:
|
||||
format = "%(levelname)s %(threadName)s %(message)s"
|
||||
else:
|
||||
format = "%(levelname)s %(message)s"
|
||||
handler.setFormatter(logging.Formatter(format))
|
||||
|
||||
def set_debug (self, debug):
|
||||
"""Set debugging levels for configured loggers. The argument
|
||||
|
|
|
|||
Loading…
Reference in a new issue