-
Notifications
You must be signed in to change notification settings - Fork 0
/
logger.py
28 lines (23 loc) · 927 Bytes
/
logger.py
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
import os
import logging.config
class Logger(object):
tmplog = logging.getLogger()
tmplog.setLevel(logging.DEBUG)
tmplog.info("Instantiating {} class...".format(__qualname__))
del tmplog
log_config_file_path = "config/logging.ini"
log = logging.getLogger(__name__)
try:
logging.config.fileConfig(log_config_file_path)
except FileNotFoundError:
logging_error = "Could not find " + str(log_config_file_path)
log.disabled=False
log.info("LOG LEVEL {}".format(log.getEffectiveLevel()))
def __init__(self, commander_callback=None, level=None):
Logger.log.debug('{} initializing....'.format(__name__))
self.log = Logger.log
self.log.disabled = False
if level:
self.log.setLevel(level)
self.log.debug("{} init complete...".format(__name__))
self.log.debug("LOG LEVEL {}".format(self.log.getEffectiveLevel()))