From d0b5d0cc65c693ab21fff85d2cc2854c3fc08d6d Mon Sep 17 00:00:00 2001 From: Jan Vcelak Date: Thu, 7 Jan 2010 15:17:18 +0100 Subject: [PATCH] tuned.py: logging level can be set separately for each module --- tuned.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tuned.py b/tuned.py index b75d1cd..89b6bae 100644 --- a/tuned.py +++ b/tuned.py @@ -81,9 +81,11 @@ class Tuned: self.__initplugins__(path, "monitorplugins", self.mp) self.__initplugins__(path, "tuningplugins", self.tp) - for p in self.mp: - p.init(self.config) - for p in self.tp: + + for p in self.mp + self.tp: + if not debug and self.config.has_option(p.config_section, "logging"): + logging.getLogger("tuned.%s" % p.config_section.lower()).setLevelString(self.config.get(p.config_section, "logging")) + p.init(self.config) def run(self):