Fix root.handlers check which I accidentally removed.
This commit is contained in:
parent
b68ac864fa
commit
ea08e2399e
1 changed files with 3 additions and 0 deletions
|
@ -54,6 +54,9 @@ def basic_config(level):
|
||||||
This adds a handler with the given level to the root logger, but only
|
This adds a handler with the given level to the root logger, but only
|
||||||
if it has no handlers yet.
|
if it has no handlers yet.
|
||||||
'''
|
'''
|
||||||
|
if root.handlers:
|
||||||
|
return
|
||||||
|
|
||||||
handler = StreamHandler()
|
handler = StreamHandler()
|
||||||
handler.setFormatter(Formatter('{levelname}:{name}:{message}', style='{'))
|
handler.setFormatter(Formatter('{levelname}:{name}:{message}', style='{'))
|
||||||
handler.setLevel(level)
|
handler.setLevel(level)
|
||||||
|
|
Loading…
Reference in a new issue