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,7 +53,12 @@ def add_loud(log):
|
||||||
|
|
||||||
def add_root_handler(level):
|
def add_root_handler(level):
|
||||||
handler = StreamHandler()
|
handler = StreamHandler()
|
||||||
handler.setFormatter(Formatter('{levelname}:{name}:{message}', style='{'))
|
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.setLevel(level)
|
handler.setLevel(level)
|
||||||
root.addHandler(handler)
|
root.addHandler(handler)
|
||||||
return handler
|
return handler
|
||||||
|
|
Loading…
Reference in a new issue