2016-02-25 11:35:16 +02:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# Author: İsmail BAŞARAN <ismail.basaran@tubitak.gov.tr> <basaran.ismaill@gmail.com>
|
|
|
|
import sys
|
|
|
|
import logging
|
|
|
|
import logging.config
|
2016-02-25 17:24:07 +02:00
|
|
|
from base.Scope import Scope
|
2016-02-25 11:35:16 +02:00
|
|
|
|
2016-02-25 17:24:07 +02:00
|
|
|
class Logger(object):
|
2016-02-25 11:35:16 +02:00
|
|
|
"""docstring for Logger"""
|
|
|
|
def __init__(self):
|
|
|
|
super(Logger, self).__init__()
|
2016-02-25 17:24:07 +02:00
|
|
|
scope = Scope.getInstance()
|
2016-02-25 11:35:16 +02:00
|
|
|
configManager = scope.getConfigurationManager()
|
|
|
|
|
|
|
|
logging.config.fileConfig(configManager.get('BASE','logConfigurationFilePath'))
|
|
|
|
self.logger = logging.getLogger()
|
|
|
|
|
|
|
|
def getLogger(self):
|
|
|
|
return self.logger
|
|
|
|
|
|
|
|
def info(self,logstring):
|
|
|
|
self.logger.info(logstring)
|
|
|
|
|
|
|
|
def warning(self,logstring):
|
|
|
|
self.logger.warning(logstring)
|
|
|
|
|
|
|
|
def error(self,logstring):
|
|
|
|
self.logger.error(logstring)
|
|
|
|
|
|
|
|
def debug(self,logstring):
|
|
|
|
self.logger.debug(logstring)
|