Add more information when logging at DEBUG, LOUD.
This commit is contained in:
parent
36e4a44bfb
commit
59b0916f88
1 changed files with 6 additions and 1 deletions
|
@ -53,6 +53,11 @@ def add_loud(log):
|
||||||
|
|
||||||
def add_root_handler(level):
|
def add_root_handler(level):
|
||||||
handler = StreamHandler()
|
handler = StreamHandler()
|
||||||
|
if level <= LOUD:
|
||||||
|
handler.setFormatter(Formatter('{levelname}:{name}.{funcName}.{lineno}:{message}', style='{'))
|
||||||
|
elif level <= DEBUG:
|
||||||
|
handler.setFormatter(Formatter('{levelname}:{name}.{funcName}:{message}', style='{'))
|
||||||
|
else:
|
||||||
handler.setFormatter(Formatter('{levelname}:{name}:{message}', style='{'))
|
handler.setFormatter(Formatter('{levelname}:{name}:{message}', style='{'))
|
||||||
handler.setLevel(level)
|
handler.setLevel(level)
|
||||||
root.addHandler(handler)
|
root.addHandler(handler)
|
||||||
|
|
Loading…
Reference in a new issue