diff --git a/config_example/config.j2 b/config_example/config.j2 index 09b02f5..e391072 100644 --- a/config_example/config.j2 +++ b/config_example/config.j2 @@ -4,7 +4,8 @@ import report from topics import * DEBUG = False # False: logging to stdout with given LOGLEVEL - True: logging all to localhost:19996 and warnings or higher to stdout -LOGLEVEL = logging.INFO +LOG_HOSTNAME = "localhost" # When DEBUG is True +LOG_LEVEL = logging.INFO # STDOUT logging GEO_POSITION = geo.gps.coordinate(lat=49.519167, lon=9.3672222) diff --git a/report b/report index 7003c13..92bf9fb 160000 --- a/report +++ b/report @@ -1 +1 @@ -Subproject commit 7003c13ef8c7e7c3a55a545cbbad4039cc024a9f +Subproject commit 92bf9fb66a809a8bc71b02b6b815a4b00d56e445 diff --git a/smart_brain.py b/smart_brain.py index 0b14b84..ffbcb93 100644 --- a/smart_brain.py +++ b/smart_brain.py @@ -42,11 +42,9 @@ if __name__ == "__main__": # # Logging # + report.add_handler_stdout(logger, config.LOG_LEVEL) if config.DEBUG: - report.appLoggingConfigure(None, 'stdout', ((config.APP_NAME, logging.DEBUG), ), - target_level=logging.WARNING, fmt=report.SHORT_FMT, host='localhost', port=19996) - else: - report.stdoutLoggingConfigure(((config.APP_NAME, config.LOGLEVEL), ), report.SHORT_FMT) + report.add_handler_socket(logger, host=config.LOG_HOSTNAME) # # MQTT Client