logging basicconig marcsello edition
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2020-09-18 14:45:58 +02:00
parent f18d2018e3
commit d9d0dcdbaf
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047

View File

@ -1,4 +1,5 @@
#!/usr/bin/env python3
import sys
import json
import logging
@ -69,7 +70,8 @@ def on_message(channel, method_frame, header_frame, body):
if __name__ == "__main__":
logging.basicConfig(level="DEBUG")
logging.basicConfig(stream=sys.stdout, format="%(asctime)s - %(name)s [%(levelname)s]: %(message)s",
level=logging.DEBUG if '--debug' in sys.argv else logging.INFO)
logging.info("Guard service starting")
mqtt = MQTT()
mqtt.topic = config.MQTT_TOPIC