diff --git a/src/aw_watcher_input/main.py b/src/aw_watcher_input/main.py index 9980e1a..7d86530 100644 --- a/src/aw_watcher_input/main.py +++ b/src/aw_watcher_input/main.py @@ -13,8 +13,12 @@ @click.command() @click.option("--testing", is_flag=True) -def main(testing: bool): - logging.basicConfig(level=logging.INFO) +@click.option("--debug", is_flag=True) +def main(testing: bool, debug:bool): + if debug: + logging.basicConfig(level=logging.DEBUG) + else: + logging.basicConfig(level=logging.INFO) logger.info("Starting watcher...") client = aw_client.ActivityWatchClient("aw-watcher-input", testing=testing) client.connect() @@ -49,8 +53,8 @@ def main(testing: bool): pulsetime = 0.0 if all(map(lambda v: v == 0, merged_data.values())): pulsetime = poll_time + 0.1 - logger.info("No new input") + logger.debug("No new input") else: - logger.info(f"New input: {e}") + logger.debug(f"New input: {e}") client.heartbeat(bucket_name, e, pulsetime=pulsetime, queued=True)