Fix root.handlers check which I accidentally removed.

This commit is contained in:
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

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)