- Timestamp each line in debug log, for easier problem tracking.
- Close and re-open debug log every 2000 lines, to enable log rotation software to replace the log while bitcoin continues uninterrupted operation.
Improve debug logging #90
pull jgarzik wants to merge 1 commits into bitcoin:master from jgarzik:logging changing 1 files +10 −2-
jgarzik commented at 1:57 AM on March 3, 2011: contributor
-
5924491c3f
logging improvements: timestamps and close/re-open
* Timestamp each log line. This greatly assists in problem tracking. * Close the debug log every 2,000 lines (and re-open on 2001st line). This enable log rotation software to easily replace the debug log while bitcoin continues uninterrupted operation.
-
gavinandresen commented at 2:42 AM on March 3, 2011: contributor
Danger! Danger!
The close and re-open will cause core dump because it's not thread-safe. I went down that rabbit-hole, and it's not pretty (don't be tempted to just wrap the printf in a CRITICAL_SECTION, because that causes issues during shutdown).
I like the timestamping, though.
- glv2 referenced this in commit 5d762236b2 on Apr 15, 2014
- glv2 referenced this in commit 33963bdc77 on Jul 22, 2014
- dexX7 referenced this in commit 124168b7bd on Jun 26, 2015
- MarcoFalke referenced this in commit a4c7b76790 on Mar 26, 2016
- destenson referenced this in commit 070ca1f030 on Jun 26, 2016
- core-bitcoin referenced this in commit 5e19bce18d on Aug 10, 2017
- lateminer referenced this in commit 74db0262fb on Feb 23, 2019
- attilaaf referenced this in commit 9e65c99d70 on Sep 20, 2019
- rajarshimaitra referenced this in commit 35f866ef37 on Aug 5, 2021
- DrahtBot locked this on Sep 8, 2021
Contributors