emerge.log currently prints the timestamp on each line as the number of seconds since the "epoch". This is not very human readable. This is because the python function time.time() is used to print the time here. The following one line change outputs the timestamp in the format "YYY-MM-DD HH:MM:SS": diff /usr/bin/emerge /usr/bin/emerge.new 411c411 < mylogfile.write(str(time.time())[:10]+": "+mystr+"\n") --- > mylogfile.write(time.strftime("%Y-%m-%d %H:%M:%S",time.localtime())+" : "+mystr+"\n") (If you want to log the UTC timestamp, use the gmtime() function instead of localtime()). Please include this fix as soon as possible as it really makes it a lot easier to read the emerge log. See this link for the relevant forum discussion. http://forums.gentoo.org/viewtopic.php?t=238052 Reproducible: Always Steps to Reproduce: 1. 2. 3.
Hmm, this would break several popular tools.
-mylogfile.write(time.strftime("%Y-%m-%d %H:%M:%S",time.localtime())+" : "+mystr+"\n") +mylogfile.write("%s :%s\n" % (time.strftime("%Y-%m-%d %H:%M:%S",time.localtime()), mystr)) Slightly cleaner imo. :)
Marius, specific tools? Strikes me as cleaner to have it human readable, rather then epoch. If it's massive horkage, could make it an option/deploy it in a major release, although I'm inclined to think detection and handling of the two formats shouldn't be all that hard.
genlop, splat, probably also basc generally everything that analyzes build time
Portage prints the start time at the begining each instance in local format. If you want it prettier, I'd suggest using a tool to convert it from easily machine readable to easily human readable. Epochs are a lot easier to difference without thinking too much.
>>> time.ctime(1109600265) 'Mon Feb 28 09:17:45 2005' As mentioned.