aboutsummaryrefslogtreecommitdiff
path: root/source/log.py
blob: 4703142208c58e6da43b714cc5c44d775ba5d617 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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)
bgstack15