2 # -*- coding: utf-8 -*-
3 ##############################################################################
4 # Copyright (c) 2017 jose.lausuch@ericsson.com
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
15 config = ConfigParser.RawConfigParser()
16 config.read('anteater.conf')
17 anteater_log = config.get('config', 'anteater_log')
21 def __init__(self, logger_name):
22 self.logger = logging.getLogger(logger_name)
23 self.logger.propagate = 0
24 self.logger.setLevel(logging.DEBUG)
26 ch = logging.StreamHandler()
27 formatter = logging.Formatter('%(asctime)s - %(name)s - '
28 '%(levelname)s - %(message)s')
29 ch.setFormatter(formatter)
30 ch.setLevel(logging.DEBUG)
31 self.logger.addHandler(ch)
33 handler = logging.FileHandler(anteater_log)
34 handler.setFormatter(formatter)
35 handler.setLevel(logging.DEBUG)
36 self.logger.addHandler(handler)