From 403c681e3d420479747407ae77d5c157c0677dd9 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Fri, 31 Jan 2014 13:03:08 -0300 Subject: Improve logs readability - levelname: after time, fixed width, left aligned - Line number before name and with fixed width - function with () --- src/leap/bitmask/app.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/leap/bitmask/app.py') diff --git a/src/leap/bitmask/app.py b/src/leap/bitmask/app.py index 941ba4f8..a702ab3a 100644 --- a/src/leap/bitmask/app.py +++ b/src/leap/bitmask/app.py @@ -101,8 +101,9 @@ def add_logger_handlers(debug=False, logfile=None, replace_stdout=True): logger = logging.getLogger(name='leap') logger.setLevel(level) - log_format = ('%(asctime)s - %(name)s:%(funcName)s:L#%(lineno)s ' - '- %(levelname)s - %(message)s') + # levelname length == 8, since 'CRITICAL' is the longest + log_format = ('%(asctime)s - %(levelname)-8s - ' + 'L#%(lineno)-4s : %(name)s:%(funcName)s() - %(message)s') formatter = logging.Formatter(log_format) # Console handler -- cgit v1.2.3