Use UTC instead of local time in logging
ClosedPublic

Authored by mkrizek on Feb 17 2015, 6:28 AM.

Details

Test Plan

Run any task and check time that logging messages print. Worked on my machine.

Diff Detail

Repository
rLTRN libtaskotron
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mkrizek retitled this revision from to Use UTC instead of local time in logging.Feb 17 2015, 6:28 AM
mkrizek updated this object.
mkrizek edited the test plan for this revision. (Show Details)
mkrizek added reviewers: tflink, kparal, jskladan.
kparal requested changes to this revision.Feb 17 2015, 8:09 AM

Can you please also add a timezone specifier into the log format, now that we don't default to local time? I.e. instead of this

[libtaskotron:runner.py:231] 2015-02-17 08:07:08 DEBUG   Using libtaskotron 0.3.11

it would be something like this

[libtaskotron:runner.py:231] 2015-02-17 08:07:08 UTC DEBUG   Using libtaskotron 0.3.11

Thanks.

This revision now requires changes to proceed.Feb 17 2015, 8:09 AM
mkrizek updated this revision to Diff 768.Feb 17 2015, 10:57 AM
  • Add timezone to datetime formatting

So, I'm not all that enamoured with the GMT time and the timezone in the same log lines. With this patch, I get stuff like the following on my machine:

[libtaskotron:runner.py:255] 2015-02-17 11:46:16 +0000 INFO    Check execution finished.

I'm of the mind that we either use UTC or put the timezone in there. Using both is silly

After discussion with Tim, we think it should be sufficient to print the full timestamp including the timezone at the execution start (and possibly the end), and then drop the timezone from the generic logging header displayed on every line. So something like this:

[libtaskotron:runner.py:231] 2015-02-17 08:07:00 INFO     Execution started at: 2015-02-17 08:07:00 +0000
[libtaskotron:runner.py:231] 2015-02-17 08:07:08 DEBUG   Using libtaskotron 0.3.11
[libtaskotron:runner.py:231] 2015-02-17 08:07:10 DEBUG   Look, I'm doing some stuff!
[libtaskotron:runner.py:231] 2015-02-17 08:07:20 INFO     Execution finished at: 2015-02-17 08:07:20 +0000
mkrizek updated this revision to Diff 769.Feb 17 2015, 2:31 PM
  • Fix timezone concern
tflink accepted this revision.Feb 17 2015, 3:40 PM

Please fix the 2 lint errors but outside of that, looks good to me

kparal accepted this revision.Feb 17 2015, 3:55 PM
This revision is now accepted and ready to land.Feb 17 2015, 3:55 PM
This revision was automatically updated to reflect the committed changes.