change full event logging to debug; set level if DEBUG on

pull/106/head
Jeff Culverhouse 11 months ago
parent 437cfba337
commit 8bab3810fb

@ -140,7 +140,7 @@ class AmcrestAPI(object):
try: try:
config = self.devices[device_id]['config'] 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"]) if ((code == "ProfileAlarmTransmit" and config["is_ad110"])
or (code == "VideoMotion" and not config["is_ad110"])): or (code == "VideoMotion" and not config["is_ad110"])):

@ -113,6 +113,9 @@ if not 'timezone' in config:
else: else:
logger.info(f'TIMEZONE set as {config["timezone"]}') logger.info(f'TIMEZONE set as {config["timezone"]}')
if config['debug']:
logger.setLevel(logging.DEBUG)
try: try:
with AmcrestMqtt(config) as mqtt: with AmcrestMqtt(config) as mqtt:
asyncio.run(mqtt.main_loop()) asyncio.run(mqtt.main_loop())

Loading…
Cancel
Save