From: Michael Tremer Date: Sat, 4 Aug 2012 12:35:38 +0000 (+0000) Subject: Add some basic logging. X-Git-Tag: 0.0.2~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a2ff9596d1f19116d994c461aecdd3f381eb9a9;p=collecty.git Add some basic logging. --- diff --git a/collecty/__init__.py b/collecty/__init__.py index 54d820a..5fdcdd1 100644 --- a/collecty/__init__.py +++ b/collecty/__init__.py @@ -19,12 +19,22 @@ # # ############################################################################### + import signal import ConfigParser as configparser import plugins +# Initialize logging. +import logging +log = logging.getLogger("collecty") +log.level = logging.DEBUG + +handler = logging.StreamHandler() +handler.level = logging.DEBUG +log.handlers.append(handler) + class ConfigError(Exception): pass @@ -56,9 +66,6 @@ class Collecty(object): i = plugin(self, **kwargs) self.instances.append(i) - def debug(self, message): - print message - def run(self): signal.signal(signal.SIGTERM, lambda *args: self.shutdown())