Add environment variable log level

This commit is contained in:
Edward Brown 2023-09-01 15:51:37 +01:00
parent 82b878dd36
commit 636436763c

View file

@ -1,10 +1,13 @@
import hashlib
import logging
import os
from haco import constants, tuya
from haco.tasmota import Tasmota
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(levelname)-8s %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
LOG_LEVEL = os.environ.get('HACO_LOG_LEVEL', 'INFO')
logging.basicConfig(level=LOG_LEVEL, format='%(asctime)s %(levelname)-8s %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
logger = logging.getLogger(__name__)