From 96d6237c5523e52cfb09162552091b05cc569f8a Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Thu, 26 Dec 2013 17:33:49 +0100 Subject: Logging for the feedgetter module. --- pyaggr3g470r/log.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'pyaggr3g470r/log.py') diff --git a/pyaggr3g470r/log.py b/pyaggr3g470r/log.py index 9c86be74..22834e71 100755 --- a/pyaggr3g470r/log.py +++ b/pyaggr3g470r/log.py @@ -20,22 +20,24 @@ # along with this program. If not, see __author__ = "Cedric Bonhomme" -__version__ = "$Revision: 0.1 $" +__version__ = "$Revision: 0.2 $" __date__ = "$Date: 2012/10/12 $" -__revision__ = "$Date: 2012/10/12 $" +__revision__ = "$Date: 2013/12/26 $" __copyright__ = "Copyright (c) Cedric Bonhomme" __license__ = "GPLv3" +import logging + class Log(object): """ Log events. Especially events relative to authentication. """ - def __init__(self): + def __init__(self, module_name): """ Initialization of the logger. """ - import logging - self.logger = logging.getLogger("pyaggr3g470r") + self.logger = logging.getLogger(module_name) + self.logger.propagate = False hdlr = logging.FileHandler('./pyaggr3g470r/var/pyaggr3g470r.log') formater = logging.Formatter('%(asctime)s %(levelname)s %(message)s') hdlr.setFormatter(formater) -- cgit