forked from LiveCarta/BookConverter
Formatting
This commit is contained in:
@@ -20,15 +20,15 @@ class ColoredFormatter(logging.Formatter):
|
||||
|
||||
def format(self, record):
|
||||
seq = self.MAPPING.get(record.levelname, 37) # default white
|
||||
record.levelname = ('{0}{1}m{2}{3}') \
|
||||
record.levelname = '{0}{1}m{2}{3}' \
|
||||
.format(self.PREFIX, seq, record.levelname, self.SUFFIX)
|
||||
return logging.Formatter.format(self, record)
|
||||
|
||||
|
||||
class BookLogger:
|
||||
def __init__(self, name, book_id, main_logger=None,
|
||||
filemode='w+', logging_level=logging.INFO, logging_format=
|
||||
'%(asctime)s - %(levelname)s - %(message)s [%(filename)s:%(lineno)d in %(funcName)s]'):
|
||||
filemode='w+', logging_level=logging.INFO,
|
||||
logging_format='%(asctime)s - %(levelname)s - %(message)s [%(filename)s:%(lineno)d in %(funcName)s]'):
|
||||
"""
|
||||
Method for Logger configuration. Logger will write to file.
|
||||
:param name: name of the Logger.
|
||||
@@ -107,4 +107,4 @@ class BookStatusWrapper:
|
||||
self.set_status('[GENERATE]')
|
||||
|
||||
def set_error(self):
|
||||
self.set_status('[ERROR]')
|
||||
self.set_status('[ERROR]')
|
||||
|
||||
Reference in New Issue
Block a user