blob: bd4c6ef3701c1cc94b51cb622c20ed5a95c4f333 [file] [log] [blame]
Ved-vampir0c7e2d42015-03-18 17:18:47 +03001#!/usr/bin/env python
2""" Logger initialization """
3
4import logging
5
6
7def define_logger(name):
8 """ Initialization of logger"""
9 logger = logging.getLogger(name)
10 logger.setLevel(logging.INFO)
11 ch = logging.StreamHandler()
12 ch.setLevel(logging.INFO)
13 logger.addHandler(ch)
14
15 log_format = '%(asctime)s - %(levelname)s - %(name)s - %(message)s'
16 formatter = logging.Formatter(log_format,
17 "%H:%M:%S")
18 ch.setFormatter(formatter)
19 return logger