Package deefuzzer :: Package deefuzzer :: Package tools :: Module logger
[hide private]
[frames] | no frames]

Source Code for Module deefuzzer.deefuzzer.tools.logger

 1  #!/usr/bin/python 
 2  # -*- coding: utf-8 -*- 
 3   
 4  import logging 
 5   
6 -class Logger:
7 """A logging object""" 8
9 - def __init__(self, file):
10 self.logger = logging.getLogger('myapp') 11 self.hdlr = logging.FileHandler(file) 12 self.formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s') 13 self.hdlr.setFormatter(self.formatter) 14 self.logger.addHandler(self.hdlr) 15 self.logger.setLevel(logging.INFO)
16
17 - def write_info(self, message):
18 self.logger.info(message)
19
20 - def write_error(self, message):
21 self.logger.error(message)
22