Fixed logger broken by colorama (#1385)

This commit is contained in:
Nikolay Vasilchuk 2020-11-20 01:39:16 +03:00 committed by GitHub
parent 9d2b0b4e03
commit e42ce64127
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -235,6 +235,9 @@ def setup_log(debug=False, quiet=False):
logging.getLogger('urllib3').setLevel(logging.WARNING) logging.getLogger('urllib3').setLevel(logging.WARNING)
try: try:
import colorama
colorama.init(strip=True)
from colorlog import ColoredFormatter from colorlog import ColoredFormatter
logging.getLogger().handlers[0].setFormatter(ColoredFormatter( logging.getLogger().handlers[0].setFormatter(ColoredFormatter(
colorfmt, colorfmt,

View file

@ -1,6 +1,7 @@
voluptuous==0.12.0 voluptuous==0.12.0
PyYAML==5.3.1 PyYAML==5.3.1
paho-mqtt==1.5.1 paho-mqtt==1.5.1
colorama==0.4.4
colorlog==4.6.2 colorlog==4.6.2
tornado==6.0.4 tornado==6.0.4
protobuf==3.13.0 protobuf==3.13.0