Since I used dmesg for the first time I felt there was something wrong about it. Having very accurate timestamps might of course be helpful for many people, but sometimes you just want to know when something happened.
dmesg prints timestamps in the form of seconds.nanoseconds
since the system booted. And no, there seems to be no -h option to make it human readable.
Today I felt like writing some Python for that, and pydmesg is the result. Is a simple script that fetches the uptime from /proc/uptime
and uses it to print nice dmesg timestamps (timestamp format can be changed by editing the file).
Before:
[499902.343696] uvcvideo: Failed to query (1) UVC ...
[499902.354633] uvcvideo: Failed to query (1) UVC ...
[530442.358520] npviewer.bin[8818]: segfault at ...
After:
[2010-08-21 13:12:37] uvcvideo: Failed to query (1) UVC ...
[2010-08-21 13:12:37] uvcvideo: Failed to query (1) UVC ...
[2010-08-21 21:41:37] npviewer.bin [8818]: segfault at ...
By default precision is set to the second, which I guess is ok for
human beings ;–)
[gist]https://gist.github.com/542780[/gist]