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

20 lines
535 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
class Logger(object):
"""docstring for Logger"""
def __init__(self, logfilepath, loglevel):
super(Logger, self).__init__()
logging.config.fileConfig('logging.conf')
self.logger = logging.basicConfig(filename=logfilepath,level=loglevel)
def info(self,logstring):
self.logger.info(logstring)
def warning(self,logstring):
self.logger.warning(logstring)