Fix root.handlers check which I accidentally removed.

master
voussoir 2021-10-24 23:30:41 -07:00
parent b68ac864fa
commit ea08e2399e
No known key found for this signature in database
GPG Key ID: 5F7554F8C26DACCB
1 changed files with 3 additions and 0 deletions

View File

@ -54,6 +54,9 @@ def basic_config(level):
This adds a handler with the given level to the root logger, but only
if it has no handlers yet.
'''
if root.handlers:
return
handler = StreamHandler()
handler.setFormatter(Formatter('{levelname}:{name}:{message}', style='{'))
handler.setLevel(level)