From acae80d2c0638ed13a554c90caa858f075d4e140 Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Thu, 24 Jul 2025 14:18:53 +0200 Subject: [PATCH] report update for logging definitions --- ambient_info.py | 8 ++++++-- config_example/config.j2 | 6 ++---- mqtt | 2 +- report | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ambient_info.py b/ambient_info.py index 96bb4df..38a6400 100644 --- a/ambient_info.py +++ b/ambient_info.py @@ -78,8 +78,12 @@ def bmp_callback(**data): if __name__ == '__main__': - report.appLoggingConfigure(config.__BASEPATH__, config.LOGTARGET, ((config.APP_NAME, config.LOGLVL), ), - fmt=config.formatter, host=config.LOGHOST, port=config.LOGPORT) + # + # Logging + # + report.add_handler_stdout(logger, config.LOG_LEVEL) + if config.DEBUG: + report.add_handler_socket(logger, host=config.LOG_HOSTNAME) # # Initialise data collectors diff --git a/config_example/config.j2 b/config_example/config.j2 index 9c9c0d3..8f9c5a1 100644 --- a/config_example/config.j2 +++ b/config_example/config.j2 @@ -27,10 +27,8 @@ else: # Logging # APP_NAME = "ambient_info" -LOGTARGET = 'stdout' # possible choices are: 'logfile' or 'stdout' -LOGLVL = 'WARNING' -LOGHOST = 'cutelog' -LOGPORT = 19996 +LOG_HOSTNAME = "loggy" # When DEBUG is True +LOG_LEVEL = logging.INFO # STDOUT logging formatter = report.SHORT_FMT diff --git a/mqtt b/mqtt index 328d347..14e56cc 160000 --- a/mqtt +++ b/mqtt @@ -1 +1 @@ -Subproject commit 328d3471a748472695a61193becdda76c7eefe69 +Subproject commit 14e56ccdbf6594f699b4afcfb4acafe9b899e914 diff --git a/report b/report index 21bac82..92bf9fb 160000 --- a/report +++ b/report @@ -1 +1 @@ -Subproject commit 21bac82e0c459ebf6d34783c9249526a657a6bbd +Subproject commit 92bf9fb66a809a8bc71b02b6b815a4b00d56e445