ahenk logging file

This commit is contained in:
İsmail Başaran 2016-02-08 19:03:04 +02:00
parent 306334ddc9
commit 86484d114c
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,20 @@
#!/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)

View File