Move setting BitBotFormatter's converter (to time.gmtime) to class definition as
it's not technically correct to overwrite a funcion on an existing object
This commit is contained in:
parent
b58a3f7329
commit
7d54bd6ad0
1 changed files with 1 additions and 1 deletions
|
@ -10,6 +10,7 @@ LEVELS = {
|
|||
}
|
||||
|
||||
class BitBotFormatter(logging.Formatter):
|
||||
converter = time.gmtime
|
||||
def formatTime(self, record, datefmt=None):
|
||||
ct = self.converter(record.created)
|
||||
if datefmt:
|
||||
|
@ -36,7 +37,6 @@ class Log(object):
|
|||
formatter = BitBotFormatter(
|
||||
"%(asctime)s [%(levelname)s] %(message)s",
|
||||
"%Y-%m-%dT%H:%M:%S.%fZ")
|
||||
formatter.converter = time.gmtime
|
||||
|
||||
stdout_handler = logging.StreamHandler(sys.stdout)
|
||||
stdout_handler.setLevel(stdout_level)
|
||||
|
|
Loading…
Reference in a new issue