aboutsummaryrefslogtreecommitdiff
path: root/source/log.py
diff options
context:
space:
mode:
Diffstat (limited to 'source/log.py')
-rwxr-xr-xsource/log.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/source/log.py b/source/log.py
new file mode 100755
index 00000000..47031422
--- /dev/null
+++ b/source/log.py
@@ -0,0 +1,28 @@
+# -*- coding: utf-8 -*-
+
+
+class Log(object):
+ """
+ """
+ def __init__(self):
+ """
+ """
+ import logging
+ self.logger = logging.getLogger("pyaggr3g470r")
+ hdlr = logging.FileHandler('./var/access.log')
+ formater = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
+ hdlr.setFormatter(formater)
+ self.logger.addHandler(hdlr)
+ self.logger.setLevel(logging.INFO)
+
+ def info(self, message):
+ self.logger.info(message)
+
+ def warning(self, message):
+ self.logger.warning(message)
+
+ def error(self, message):
+ self.logger.warning(message)
+
+ def critical(self, message):
+ self.logger.critical(message) \ No newline at end of file
bgstack15