-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Remove #define printf, replace OutputDebugStringf with LogPrint(f) #3009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Remove #define printf, replace OutputDebugStringf with LogPrint(f)
Agree 100% that calling this printf() causes no end of a annoying problems and minor confusions. Went ahead and merged this, because otherwise it will quickly and perpetually be out-of-date. If anybody thinks this is NAK-worthy, still speak up, and we can back it out (though I hope not). |
Posthumous ACK. |
ACK, finally! |
Automatic sanity-testing: FAILED BUILD/TEST, see http://jenkins.bluematt.me/pull-tester/881a85a22d76c875f519cd54388a419ec6f70857 for binaries and test log. This could happen for one of several reasons:
If you believe this to be in error, please ping BlueMatt on freenode or TheBlueMatt here. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ |
NACK! There is far too much debug.log output now:- 2014-02-25 03:45:50 sending getdata: tx 7007611c2899e2e7fd26d715d9dbadee0427a5967e586b7f2f3bc3c4f10f86e1 Can we do something to reduce this without stopping the useful debug.log info that was there previously? |
…to specify quorum scan count (bitcoin#3009) * Add "isValidMember" and "memberIndex" to output of "quorum memberof" * Allow to specify how many quorums to scan for in "quorum memberof"
…to specify quorum scan count (bitcoin#3009) * Add "isValidMember" and "memberIndex" to output of "quorum memberof" * Allow to specify how many quorums to scan for in "quorum memberof"
I finally got fed up enough with our lousy logging to do something about it.
So: I replaced all instances of printf() in our code with either LogPrint or LogPrintf.
LogPrintf("foo\n"); is a straight replacement for printf/OutputDebugStringf("foo\n"). It writes printf-formatted arguments to debug.log (or console if -printtoconsole). Use it for messages that should always go into debug.log (errors, startup info, etc).
LogPrint("category", ...); is new-- it only logs if you pass a -debug=category flag. Run with multiple -debug= arguments to log more than one category (e.g. bitcoind -debug=net -debug=mempool ). I defined the following categories:
net
mempool
rpc
alert
db
addr
addrman
coindb
rand
If y'all like this, feel free to add more categories, rename/combine these, etc.