Adaption to default logging method
This commit is contained in:
parent
cefcefc5a1
commit
2063403ed6
@ -3,13 +3,20 @@ import logging
|
|||||||
import report
|
import report
|
||||||
from topics import *
|
from topics import *
|
||||||
|
|
||||||
DEBUG = False # False: logging to stdout with given LOGLEVEL - True: logging all to localhost:19996 and warnings or higher to stdout
|
DEBUG = False
|
||||||
|
#
|
||||||
|
# Logging
|
||||||
|
#
|
||||||
|
APP_NAME = "smart_brain"
|
||||||
LOG_HOSTNAME = "loggy" # When DEBUG is True
|
LOG_HOSTNAME = "loggy" # When DEBUG is True
|
||||||
LOG_LEVEL = logging.INFO # STDOUT logging
|
LOG_LEVEL = logging.INFO # STDOUT logging
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Application
|
||||||
|
#
|
||||||
GEO_POSITION = geo.gps.coordinate(lat=49.519167, lon=9.3672222)
|
GEO_POSITION = geo.gps.coordinate(lat=49.519167, lon=9.3672222)
|
||||||
|
|
||||||
APP_NAME = "smart_brain"
|
|
||||||
|
|
||||||
MQTT_SERVER = "{{ smart_srv_brain_hostname }}"
|
MQTT_SERVER = "{{ smart_srv_brain_hostname }}"
|
||||||
MQTT_PORT = 1883
|
MQTT_PORT = 1883
|
||||||
|
2
report
2
report
@ -1 +1 @@
|
|||||||
Subproject commit 92bf9fb66a809a8bc71b02b6b815a4b00d56e445
|
Subproject commit 9ad0dd05a5daaed39308e5c5fd87d46e142fd800
|
@ -9,7 +9,7 @@ import report
|
|||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
|
|
||||||
logger = logging.getLogger(config.APP_NAME)
|
logger = report.default_logging_config()
|
||||||
|
|
||||||
|
|
||||||
VERS_MAJOR = 1
|
VERS_MAJOR = 1
|
||||||
@ -39,13 +39,6 @@ def __info_publisher__(client, userdata, message):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
#
|
|
||||||
# Logging
|
|
||||||
#
|
|
||||||
report.add_handler_stdout(logger, config.LOG_LEVEL)
|
|
||||||
if config.DEBUG:
|
|
||||||
report.add_handler_socket(logger, host=config.LOG_HOSTNAME)
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# MQTT Client
|
# MQTT Client
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user