On issue #113, it is asked that we start to display timezone info in autotest logs, to help people to debug issues. After a bit of research, apparently in some cases the value of the UTC offset is not reliable, so it's better to simply add plain timezone info.
The resulting console logs would be like: 18:19:40 BRST INFO | Writing results to /home/lmr/Code/autotest.lmr/client/results/default 18:19:56 BRST INFO | START ---- ---- timestamp=1323807596 localtime=Dec 13 18:19:56 18:19:56 BRST INFO | START sleeptest sleeptest timestamp=1323807596 localtime=Dec 13 18:19:56 18:20:20 BRST INFO | GOOD sleeptest sleeptest timestamp=1323807620 localtime=Dec 13 18:20:20 completed successfully 18:20:20 BRST INFO | END GOOD sleeptest sleeptest timestamp=1323807620 localtime=Dec 13 18:20:20 18:20:23 BRST INFO | END GOOD ---- ---- timestamp=1323807623 localtime=Dec 13 18:20:23 Please let us know if you have an issue with that. Signed-off-by: Lucas Meneghel Rodrigues <[email protected]> --- client/common_lib/logging_config.py | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/client/common_lib/logging_config.py b/client/common_lib/logging_config.py index 6f299f1..45603d9 100644 --- a/client/common_lib/logging_config.py +++ b/client/common_lib/logging_config.py @@ -1,5 +1,4 @@ import logging, os, sys, time - # set up a simple catchall configuration for use during import time. some code # may log messages at import time and we don't want those to get completely # thrown away. we'll clear this out when actual configuration takes place. @@ -26,11 +25,11 @@ class LoggingConfig(object): file_formatter = logging.Formatter( fmt='%(asctime)s %(levelname)-5.5s|%(module)10.10s:%(lineno)4.4d| ' '%(message)s', - datefmt='%m/%d %H:%M:%S') + datefmt='%m/%d %H:%M:%S %Z') console_formatter = logging.Formatter( fmt='%(asctime)s %(levelname)-5.5s| %(message)s', - datefmt='%H:%M:%S') + datefmt='%H:%M:%S %Z') def __init__(self, use_console=True): self.logger = logging.getLogger() -- 1.7.7.3 _______________________________________________ Autotest mailing list [email protected] http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
