diff options
author | cedricbonhomme <devnull@localhost> | 2012-10-12 07:49:11 +0200 |
---|---|---|
committer | cedricbonhomme <devnull@localhost> | 2012-10-12 07:49:11 +0200 |
commit | 62adfb02c3d420e85e3e69a332eeee60f20de75f (patch) | |
tree | 6bb2b3d0efc8e7fa54a78aa22227da179e568621 | |
parent | Added authentication module. (diff) | |
download | newspipe-62adfb02c3d420e85e3e69a332eeee60f20de75f.tar.gz newspipe-62adfb02c3d420e85e3e69a332eeee60f20de75f.tar.bz2 newspipe-62adfb02c3d420e85e3e69a332eeee60f20de75f.zip |
Added logginn module (for the authentication).
-rwxr-xr-x | source/log.py | 28 |
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 |