mirror of
https://github.com/Pardus-LiderAhenk/ahenk
synced 2024-11-22 15:32:19 +03:00
ahenk logging file
This commit is contained in:
parent
306334ddc9
commit
86484d114c
2 changed files with 20 additions and 0 deletions
20
opt/ahenk/base/logging/AhenkLogger.py
Normal file
20
opt/ahenk/base/logging/AhenkLogger.py
Normal 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)
|
0
opt/ahenk/base/logging/__init__.py
Normal file
0
opt/ahenk/base/logging/__init__.py
Normal file
Loading…
Reference in a new issue