From 86484d114c6600e1e3977e10370a9ddbf7aed390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0smail=20Ba=C5=9Faran?= Date: Mon, 8 Feb 2016 19:03:04 +0200 Subject: [PATCH] ahenk logging file --- opt/ahenk/base/logging/AhenkLogger.py | 20 ++++++++++++++++++++ opt/ahenk/base/logging/__init__.py | 0 2 files changed, 20 insertions(+) create mode 100644 opt/ahenk/base/logging/AhenkLogger.py create mode 100644 opt/ahenk/base/logging/__init__.py diff --git a/opt/ahenk/base/logging/AhenkLogger.py b/opt/ahenk/base/logging/AhenkLogger.py new file mode 100644 index 0000000..6f353d7 --- /dev/null +++ b/opt/ahenk/base/logging/AhenkLogger.py @@ -0,0 +1,20 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# Author: İsmail BAŞARAN + +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) \ No newline at end of file diff --git a/opt/ahenk/base/logging/__init__.py b/opt/ahenk/base/logging/__init__.py new file mode 100644 index 0000000..e69de29