Top

telemeta.util.logger module

# -*- coding: utf-8 -*-

import logging

class Logger:
    """A logging object"""

    def __init__(self, file):
        self.logger = logging.getLogger('myapp')
        self.hdlr = logging.FileHandler(file)
        self.formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
        self.hdlr.setFormatter(self.formatter)
        self.logger.addHandler(self.hdlr)
        self.logger.setLevel(logging.INFO)

    def debug(self, msg):
        self.logger.error('DEBUG : ' + message)
        

Classes

class Logger

A logging object

class Logger:
    """A logging object"""

    def __init__(self, file):
        self.logger = logging.getLogger('myapp')
        self.hdlr = logging.FileHandler(file)
        self.formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
        self.hdlr.setFormatter(self.formatter)
        self.logger.addHandler(self.hdlr)
        self.logger.setLevel(logging.INFO)

    def debug(self, msg):
        self.logger.error('DEBUG : ' + message)

Ancestors (in MRO)

Instance variables

var formatter

var hdlr

var logger

Methods

def __init__(

self, file)

def __init__(self, file):
    self.logger = logging.getLogger('myapp')
    self.hdlr = logging.FileHandler(file)
    self.formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
    self.hdlr.setFormatter(self.formatter)
    self.logger.addHandler(self.hdlr)
    self.logger.setLevel(logging.INFO)

def debug(

self, msg)

def debug(self, msg):
    self.logger.error('DEBUG : ' + message)