From c57cc49addf3d799a6d8e00a581105137895e243 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Thu, 19 Dec 2019 12:51:52 +0100 Subject: [PATCH] add debug outpout --- cleanupagents/Cli.py | 1 + cleanupagents/Logging.py | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/cleanupagents/Cli.py b/cleanupagents/Cli.py index d4a92e0..4437d74 100644 --- a/cleanupagents/Cli.py +++ b/cleanupagents/Cli.py @@ -86,6 +86,7 @@ class AgentCleanup: dry = self.config["dry_run"] dryrun_msg = "" + self.logger.debug("Pending object dump: {}".format(pending)) if dry: dryrun_msg = "[DRYRUN] " diff --git a/cleanupagents/Logging.py b/cleanupagents/Logging.py index dba5e5e..af8db0a 100644 --- a/cleanupagents/Logging.py +++ b/cleanupagents/Logging.py @@ -66,7 +66,6 @@ class MultilineJsonFormatter(jsonlogger.JsonFormatter): class Log: def __init__(self, level=logging.WARN, name="cleanupagents", logfile="/var/log/drone-agents.log", json=False): self.logger = logging.getLogger(name) - self.logger.handlers.clear() self.logger.setLevel(level) self.logger.addHandler(self._get_error_handler(json=json)) self.logger.addHandler(self._get_warn_handler(json=json))