Ahenk/opt/ahenk/base/logging/AhenkLogger.py

33 lines
788 B
Python
Raw Normal View History

2016-02-08 19:03:04 +02:00
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Author: İsmail BAŞARAN <ismail.basaran@tubitak.gov.tr> <basaran.ismaill@gmail.com>
import logging
import logging.config
2016-02-21 03:24:54 +02:00
from ahenkd import AhenkDeamon
2016-02-08 19:03:04 +02:00
class Logger(object):
"""docstring for Logger"""
2016-02-21 03:24:54 +02:00
def __init__(self):
2016-02-08 19:03:04 +02:00
super(Logger, self).__init__()
2016-02-21 03:24:54 +02:00
scope = AhenkDeamon.scope()
configManager = scope.getConfigurationManager()
logging.config.fileConfig(configManager.get('BASE','logConfigurationFilePath'))
self.logger = logging.getLogger()
def getLogger(self):
return self.logger
2016-02-08 19:03:04 +02:00
def info(self,logstring):
self.logger.info(logstring)
def warning(self,logstring):
2016-02-21 03:24:54 +02:00
self.logger.warning(logstring)
def error(self,logstring):
self.logger.error(logstring)
def debug(self,logstring):
self.logger.debug(logstring)