summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-03-02 13:49:56 +0000
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-03-02 13:49:56 +0000
commitf45102c3260b6e534f1c4b5158f765c3d1ae1647 (patch)
tree8c57f34649c2c8edc59ee4c811ee444acb39d966
parentfa08b287713bc6b34133fc28d4cdaf97021631a0 (diff)
downloadpykolab-f45102c3260b6e534f1c4b5158f765c3d1ae1647.tar.gz
Let's use the logger if we have it.
-rw-r--r--pykolab/plugins.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/pykolab/plugins.py b/pykolab/plugins.py
index 0001482..0c0c272 100644
--- a/pykolab/plugins.py
+++ b/pykolab/plugins.py
@@ -95,7 +95,10 @@ class KolabPlugins:
print >> sys.stderr, _("Cannot set defaults for plugin %s: Unknown Error") % (plugin)
else:
- print >> sys.stderr, _("Not setting defaults for plugin %s: No function 'set_defaults()'") % plugin
+ if hasattr(self.conf, "log"):
+ self.conf.log.debug(_("Not setting defaults for plugin %s: No function 'set_defaults()'") % plugin, level=5)
+ else:
+ print >> sys.stderr, _("Not setting defaults for plugin %s: No function 'set_defaults()'") % plugin
def set_runtime(self, runtime, plugins=[]):
"""Set runtime variables from plugins, like 'i_did_all_this'"""
@@ -133,7 +136,10 @@ class KolabPlugins:
except RuntimeError, e:
print >> sys.stderr, _("Cannot add options for plugin %s: %s") % (plugin,e)
else:
- print >> sys.stderr, _("Not adding options for plugin %s: No function 'add_options()'") % plugin
+ if hasattr(self.conf, "log"):
+ self.conf.log.debug(_("Not adding options for plugin %s: No function 'add_options()'") % plugin, level=5)
+ else:
+ print >> sys.stderr, _("Not adding options for plugin %s: No function 'add_options()'") % plugin
def check_options(self, conf, plugins=[]):
"""Executes plugin.check_plugins() for all enabled plugins or the list of plugin names specified."""