fix: mqttc读取loglevel
This commit is contained in:
parent
84e92d3ee8
commit
964cb00d1b
2
mqttc.py
2
mqttc.py
|
@ -21,7 +21,7 @@ import conf
|
||||||
|
|
||||||
|
|
||||||
LOG_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'mqttc.log')
|
LOG_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'mqttc.log')
|
||||||
logging.basicConfig(level=conf.LOG_LEVEL,
|
logging.basicConfig(level=getattr(logging, conf.LOG_LEVEL.upper(), logging.INFO),
|
||||||
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
||||||
handlers=[
|
handlers=[
|
||||||
logging.StreamHandler(sys.stdout), # Log to console
|
logging.StreamHandler(sys.stdout), # Log to console
|
||||||
|
|
Loading…
Reference in New Issue