[tahoe-dev] timestamps (was: collective effort to improve logging)

Brian Warner warner at allmydata.com
Mon Sep 17 22:11:35 UTC 2007


> So the tai64:
> 
> >  @4000000046eeac0b074a2854 [Client] z23k6ynh: 'connected to qtjkk6cy'
> 
> Could be replaced by a human-readable ISO UTC timestamp, for our  
> purposes:
> 
> >  2007-09-17 09:32:01.122300 [Client] z23k6ynh: 'connected to qtjkk6cy'

Well, one small but subtle feature to point out is that this expanded form
gives no suggestion as to whether it is UTC or localtime. I guarantee that at
least one person will look in their tahoe logs and say "whoa, why is my clock
running so slow?" (and at least one person in europe who will think their
clock is fast). A perhaps-unexpected benefit using something that's not human
readable (like TAI64) is that it's less likely to provide a false expectation
like this. When you're using TAI64 (or a binary form) the
UTC-vs-localtime-ness of a converted form depends upon (and is signalled by)
whichever conversion tool you chose to use.

That said, I did some more digging, and in fact there is no pre-made tool to
convert TAI64 to UTC (the only tool is /usr/bin/tai64nlocal, which always
converts it to localtime). Also, it turns out that TAI64N only has nanosecond
resolution: the format is hex(seconds)+hex(nanoseconds), and it omits the
decimal point. You have to use TAI64NA to get attosecond resolution.

 -Brian









More information about the tahoe-dev mailing list