updated log levels
This commit is contained in:
parent
61c627df91
commit
5732951cde
@ -1,10 +1,14 @@
|
|||||||
def cont_log(self):
|
def cont_log(self):
|
||||||
"""Setting up the log file, if self.use_log is set to true and self.loglevel is DEBUG OR INFO"""
|
"""Setting up the log file, if self.use_log is set to true and self.loglevel is DEBUG OR INFO"""
|
||||||
if self.use_log:
|
if self.use_log:
|
||||||
if self.log_level == 'DEBUG':
|
if self.log_level.lower() == 'debug':
|
||||||
self.tl.basicConfig(filename=self.log_path, format='%(asctime)s:%(levelname)s:%(message)s', encoding='utf-8', datefmt='%m/%d/%Y %I:%M:%S %p',level=self.tl.DEBUG)
|
self.tl.basicConfig(filename=self.log_path, format='%(asctime)s:%(levelname)s:%(message)s', encoding='utf-8', datefmt='%m/%d/%Y %I:%M:%S %p',level=self.tl.DEBUG)
|
||||||
elif self.log_level == 'INFO':
|
elif self.log_level.lower() == 'info':
|
||||||
self.tl.basicConfig(filename=self.log_path, format='%(asctime)s:%(levelname)s:%(message)s', encoding='utf-8', datefmt='%m/%d/%Y %I:%M:%S %p',level=self.tl.INFO)
|
self.tl.basicConfig(filename=self.log_path, format='%(asctime)s:%(levelname)s:%(message)s', encoding='utf-8', datefmt='%m/%d/%Y %I:%M:%S %p',level=self.tl.INFO)
|
||||||
|
elif self.log_level.lower() == 'warn':
|
||||||
|
self.tl.basicConfig(filename=self.log_path, format='%(asctime)s:%(levelname)s:%(message)s', encoding='utf-8', datefmt='%m/%d/%Y %I:%M:%S %p',level=self.tl.WARN)
|
||||||
|
elif self.log_level.lower() == 'error':
|
||||||
|
self.tl.basicConfig(filename=self.log_path, format='%(asctime)s:%(levelname)s:%(message)s', encoding='utf-8', datefmt='%m/%d/%Y %I:%M:%S %p',level=self.tl.ERROR)
|
||||||
|
|
||||||
def cont_notify(self):
|
def cont_notify(self):
|
||||||
"""Seting up to use pushover, if self.use_pushover is set to true and
|
"""Seting up to use pushover, if self.use_pushover is set to true and
|
||||||
|
2
crane.py
2
crane.py
@ -54,7 +54,7 @@ class Crn:
|
|||||||
self.tl.debug('Building container list.')
|
self.tl.debug('Building container list.')
|
||||||
self.process_cont_list_response = process_cont_list(self.cont_list, c_start_container, self.cc, self.host, self.port, self.jwt, self.endpoint)
|
self.process_cont_list_response = process_cont_list(self.cont_list, c_start_container, self.cc, self.host, self.port, self.jwt, self.endpoint)
|
||||||
if self.process_cont_list_response:
|
if self.process_cont_list_response:
|
||||||
self.tl.info(f'Started: [{self.process_cont_list_response}]')
|
self.tl.warn(f'Started: [{self.process_cont_list_response}]')
|
||||||
|
|
||||||
except requests.exceptions.RequestException as e:
|
except requests.exceptions.RequestException as e:
|
||||||
self.tl.exception(e)
|
self.tl.exception(e)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user