From 0ee0c42d549b459ef885874b70a8e1d91e4901fb Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 10 May 2015 19:21:01 +0000 Subject: [PATCH] Silence non-debugging output a bit --- src/collecty/daemon.py | 12 +++++------- src/collecty/plugins/base.py | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/collecty/daemon.py b/src/collecty/daemon.py index 2fa000f..0f1c34d 100644 --- a/src/collecty/daemon.py +++ b/src/collecty/daemon.py @@ -64,7 +64,7 @@ class Collecty(object): for plugin in plugins.get(): self.add_plugin(plugin) - log.info(_("Collecty successfully initialized with %s plugins") \ + log.debug(_("Collecty successfully initialized with %s plugins") \ % len(self.plugins)) def add_plugin(self, plugin_class): @@ -122,7 +122,7 @@ class Collecty(object): if not self.running: return - log.debug(_("Received shutdown signal")) + log.info(_("Received shutdown signal")) self.running = False # Propagating shutdown to all threads. @@ -169,7 +169,6 @@ class WriteQueue(threading.Thread): self.collecty = collecty self.log = logging.getLogger("collecty.queue") - self.log.setLevel(logging.DEBUG) self.log.propagate = 1 self.timer = plugins.Timer(submit_interval) @@ -235,12 +234,11 @@ class WriteQueue(threading.Thread): self.log.debug(_("Emptied write queue in %.2fs") % duration) def _commit_file(self, filename, results): - self.log.debug(_("Committing %(counter)s entries to %(filename)s:") \ + self.log.debug(_("Committing %(counter)s entries to %(filename)s") \ % { "counter" : len(results), "filename" : filename }) - if self.collecty.debug: - for result in results: - self.log.debug(" %s: %s" % (result.time, result.data)) + for result in results: + self.log.debug(" %s: %s" % (result.time, result.data)) rrdtool.update(filename, *["%s" % r for r in results]) diff --git a/src/collecty/plugins/base.py b/src/collecty/plugins/base.py index 74bc712..1a03105 100644 --- a/src/collecty/plugins/base.py +++ b/src/collecty/plugins/base.py @@ -126,7 +126,7 @@ class Plugin(threading.Thread): self.running = True self.timer = Timer(self.interval) - self.log.info(_("Successfully initialized %s") % self.__class__.__name__) + self.log.debug(_("Successfully initialized %s") % self.__class__.__name__) @property def path(self): @@ -221,7 +221,7 @@ class Plugin(threading.Thread): graph = template.generate_graph(object_id=object_id, **kwargs) duration = time.time() - time_start - self.log.info(_("Generated graph %s in %.1fms") \ + self.log.debug(_("Generated graph %s in %.1fms") \ % (template, duration * 1000)) return graph -- 2.39.2