Improve log message format

This commit is contained in:
Philipp Hörist 2019-03-10 10:07:12 +01:00
parent 0eb75eb73d
commit b80bbaf2b3
2 changed files with 3 additions and 3 deletions

View File

@ -125,9 +125,9 @@ class FancyFormatter(logging.Formatter):
if self.use_color:
c = FancyFormatter.colors_mapping.get(level, '')
record.levelname = colorize(record.levelname, c)
record.name = colorize(record.name, colors.CYAN)
record.name = '%-25s' % colorize(record.name, colors.CYAN)
else:
record.name += ':'
record.name = '%-25s|' % record.name
return logging.Formatter.format(self, record)

View File

@ -86,4 +86,4 @@ def get_eme_message(eme_data):
class LogAdapter(LoggerAdapter):
def process(self, msg, kwargs):
return '[%s] %s' % (self.extra['account'], msg), kwargs
return '(%s) %s' % (self.extra['account'], msg), kwargs