From 26ef49e2351cc5a204281b53006e2697ed42ef20 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Mon, 7 Oct 2013 10:25:23 -0300 Subject: Show more context information in the logs. Add line numbers and function name from where the log is displayed. --- src/leap/bitmask/util/leap_log_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/leap/bitmask/util/leap_log_handler.py') diff --git a/src/leap/bitmask/util/leap_log_handler.py b/src/leap/bitmask/util/leap_log_handler.py index 98924c12..262f2f65 100644 --- a/src/leap/bitmask/util/leap_log_handler.py +++ b/src/leap/bitmask/util/leap_log_handler.py @@ -52,7 +52,7 @@ class LogHandler(logging.Handler): :param logging_level: the debug level to define the color. :type logging_level: str. """ - log_format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s' + log_format = '%(asctime)s - %(name)s:%(funcName)s:L#%(lineno)s - %(levelname)s - %(message)s' formatter = logging.Formatter(log_format) return formatter -- cgit v1.2.3 From a0d827d28e7aba2e55be9b1cbf04292e6c385c34 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Tue, 15 Oct 2013 11:46:08 -0300 Subject: Fix pep8 violations. --- src/leap/bitmask/util/leap_log_handler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/leap/bitmask/util/leap_log_handler.py') diff --git a/src/leap/bitmask/util/leap_log_handler.py b/src/leap/bitmask/util/leap_log_handler.py index 262f2f65..1ab62331 100644 --- a/src/leap/bitmask/util/leap_log_handler.py +++ b/src/leap/bitmask/util/leap_log_handler.py @@ -52,7 +52,8 @@ class LogHandler(logging.Handler): :param logging_level: the debug level to define the color. :type logging_level: str. """ - log_format = '%(asctime)s - %(name)s:%(funcName)s:L#%(lineno)s - %(levelname)s - %(message)s' + log_format = ('%(asctime)s - %(name)s:%(funcName)s:L#%(lineno)s ' + '- %(levelname)s - %(message)s') formatter = logging.Formatter(log_format) return formatter -- cgit v1.2.3