new timestamps #171

Closed
opened 2007-10-09 17:24:01 +00:00 by zooko · 3 comments

As per e-mail discussion, we want to make ISO-8601'ish, UTC, timestamps with "Z" appended to show that they are UTC, with milliseconds precision.

As per [e-mail discussion](http://allmydata.org/pipermail/tahoe-dev/2007-September/000145.html), we want to make ISO-8601'ish, UTC, timestamps with "Z" appended to show that they are UTC, with milliseconds precision.
zooko added the
code
minor
enhancement
0.6.0
labels 2007-10-09 17:24:01 +00:00
zooko added this to the 0.6.1 milestone 2007-10-09 17:24:01 +00:00

I've pushed a change to get most of this. It's only lacking the milliseconds, since time.strftime
doesn't provide a format character to get these. Adding milliseconds will probably require
modifying the logging code some more.. I'll look at it later in the week, maybe for 0.6.1, maybe not.

I've pushed a change to get most of this. It's only lacking the milliseconds, since time.strftime doesn't provide a format character to get these. Adding milliseconds will probably require modifying the logging code some more.. I'll look at it later in the week, maybe for 0.6.1, maybe not.

oops, so it turns out that the timeFormat= option doesn't let you make the timestamp be UTC. It's always localtime. So I just removed the misleading "Z" from the end of the string. I think we'll have to override FileLogObserver.formatTime to fix these.

So still to do:

  • add milliseconds
  • make it UTC instead of localtime
oops, so it turns out that the timeFormat= option doesn't let you make the timestamp be UTC. It's always localtime. So I just removed the misleading "Z" from the end of the string. I think we'll have to override [FileLogObserver](wiki/FileLogObserver).formatTime to fix these. So still to do: * add milliseconds * make it UTC instead of localtime

ok, I figured out how to add milliseconds and the "Z" suffix, and make it emit UTC. I create a
new FileLogObserver and replace any existing ones when the Node (i.e. Client) instance is created.
The first few log messages (emitted by twistd before the .tac file is loaded) show up with the
default Twisted format ('2007/10/11 17:26 -0700', using localtime), then they switch over to
the new format when the .tac gets control.

ok, I figured out how to add milliseconds and the "Z" suffix, and make it emit UTC. I create a new [FileLogObserver](wiki/FileLogObserver) and replace any existing ones when the Node (i.e. Client) instance is created. The first few log messages (emitted by twistd before the .tac file is loaded) show up with the default Twisted format ('2007/10/11 17:26 -0700', using localtime), then they switch over to the new format when the .tac gets control.
warner added the
fixed
label 2007-10-12 00:32:48 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: tahoe-lafs/trac-2024-07-25#171
No description provided.