Add timestamp to each line of debug.log.
Log timestamp #91
pull jgarzik wants to merge 1 commits into bitcoin:master from jgarzik:log-timestamp changing 1 files +3 −2-
jgarzik commented at 4:23 AM on March 3, 2011: contributor
-
Add timestamp prefix to each line in the debug log b4876c0cfd
-
jhyslop commented at 11:51 PM on March 7, 2011: none
I like the idea of timestamping log entries. Personally, though, I'd rather see a human-readable timestamp.
-
TheBlueMatt commented at 6:54 PM on March 9, 2011: member
I agree with jhyslop: https://github.com/TheBlueMatt/bitcoin/commit/fe460d47b06d10095b882d7a9ea8a98ad0079bbd
-
jgarzik commented at 8:29 PM on March 9, 2011: contributor
That's fine with me. I'll close this pull request, and hope that someone submits the human-readable timestamp patch instead.
Also: there was a privacy concern related to universal timestamps, so maybe add an option -logtimestamp, thereby defaulting the timestamps /off/ by default.
-
jhyslop commented at 3:29 AM on March 10, 2011: none
Actually, I plan to rework the logging slightly, so I'll add the optional timestamp when I do that. And since I'm adding a flag, there's no reason it can't be '-logtimestamp=<off | numeric | human-readable>'.
What was the privacy concern, do you remember?
My plan is to modify OutputDebugStringF to accept two parameters, one indicating the verbosity level (off, critical error, error, warning, info, debug, verbose) and the other a bitmask enum indicating the area the log entry relates to, such as Mining, Transactions, Blocks, etc. (I got tired of wading through quite literally thousands of IRC log messages, and generating a log file around 1.2M per day). Oh, and then change all 'printf' statements to OutputDebugStringF( x, y where x and y make sense given the context.
I already have that code in my local source, but it's based on the previous release and it's currently hard-coded to Debug, Mining.
-
jhyslop commented at 10:02 PM on March 13, 2011: none
Jeff, I've been working on the code as mentioned. Can you elaborate on the privacy concerns? I don't really see how the timestamps in the log could be a privacy concern.
-
jgarzik commented at 10:14 PM on March 13, 2011: contributor
Quote from IRC, <gavinandresen> Concern was from satoshi... I shouldn't try to read his mind, but I THINK what he was thinking is somebody subpoena's N bitcoin services for their debug.logs to try to figure out where transactions were originating
-
jhyslop commented at 11:49 PM on March 13, 2011: none
I wondered it might be something along those lines. As a side note, it would be an interesting challenge to figure out how many nodes you'd have to subpoena in order to determine with any degree of certainty the origin of a coin.
My revisions to OutputDebugStringF will, by default, NOT log anything to do with individual transactions. Basically, only infrequent status messages such as the hash rate, warnings, errors and critical errors will be logged by default.
Actually, before I go too far down the road with it, I think I'll open a discussion on the Bitcoin forums to get feedback on my ideas. Maybe someone there might have some additional thoughts on privacy issues.
-
jgarzik commented at 11:52 PM on March 13, 2011: contributor
In general, incremental approaches tend to work better than grand rewrites, so I would rather test the waters with BlueMatt's patch. Then, we can look into something more invasive if the community is happy with the general direction.
-
jhyslop commented at 3:48 AM on March 14, 2011: none
OK. My changes are orthogonal to BlueMatt's, so it will be simple to merge.
- glv2 referenced this in commit 0cbc41c42e on Apr 15, 2014
- glv2 referenced this in commit 43b1d8c783 on Jul 22, 2014
- dexX7 referenced this in commit fceb4daf91 on Jul 6, 2015
- destenson referenced this in commit 4d3bff6351 on Jun 26, 2016
- classesjack referenced this in commit 98ab6707eb on Jan 2, 2018
- effectsToCause referenced this in commit 4f6ccfcdf1 on Jun 22, 2018
- lateminer referenced this in commit 2c066d2f32 on Feb 23, 2019
- attilaaf referenced this in commit fcebf4fabf on Jan 13, 2020
- laanwj referenced this in commit 03ecceedf6 on Apr 14, 2021
- DrahtBot locked this on Sep 8, 2021