From 8bab3810fbb860d388a04524816cc31a24f25d42 Mon Sep 17 00:00:00 2001 From: Jeff Culverhouse Date: Tue, 4 Mar 2025 10:47:24 -0500 Subject: [PATCH] change full event logging to debug; set level if DEBUG on --- amcrest_api.py | 2 +- app.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/amcrest_api.py b/amcrest_api.py index cf7cd03..d8d7006 100644 --- a/amcrest_api.py +++ b/amcrest_api.py @@ -140,7 +140,7 @@ class AmcrestAPI(object): try: config = self.devices[device_id]['config'] - self.logger.info(f'Event on {config["host"]} - {code}: {payload}') + self.logger.debug(f'Event on {config["host"]} - {code}: {payload}') if ((code == "ProfileAlarmTransmit" and config["is_ad110"]) or (code == "VideoMotion" and not config["is_ad110"])): diff --git a/app.py b/app.py index 2b93ee3..2db9c8e 100644 --- a/app.py +++ b/app.py @@ -113,6 +113,9 @@ if not 'timezone' in config: else: logger.info(f'TIMEZONE set as {config["timezone"]}') +if config['debug']: + logger.setLevel(logging.DEBUG) + try: with AmcrestMqtt(config) as mqtt: asyncio.run(mqtt.main_loop())