Set log level from config

This commit is contained in:
Mikhail Gordeev 2019-04-04 00:07:40 +03:00
parent bddea6355a
commit fe17665682

View File

@ -41,8 +41,7 @@ class CB:
format='%(levelname)s:%(asctime)s - %(message)s',
)
self.log = logging.getLogger(PROG)
# self.log.setLevel(logging.DEBUG)
self.log.setLevel(logging.INFO)
self.log.setLevel(self.log_level)
self.info(f'Start {PROG}')
@contextlib.contextmanager
@ -62,6 +61,8 @@ class CB:
cfg.get('mkimage_profiles_git')
)
self.log_level = getattr(logging, cfg.get('log_level', 'INFO').upper())
try:
self._remote = os.path.expanduser(cfg['remote'])
self.key = cfg['key']