Skip to content

Conversation

gavinandresen
Copy link
Contributor

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.

jgarzik pushed a commit that referenced this pull request Sep 18, 2013
Remove #define printf, replace OutputDebugStringf with LogPrint(f)
@jgarzik jgarzik merged commit e0d6dd1 into bitcoin:master Sep 18, 2013
@jgarzik
Copy link
Contributor

jgarzik commented Sep 18, 2013

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).

@sipa
Copy link
Member

sipa commented Sep 18, 2013

Posthumous ACK.

@laanwj
Copy link
Member

laanwj commented Sep 18, 2013

ACK, finally!

@BitcoinPullTester
Copy link

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:

  1. It chanages paths in makefile.linux-mingw or otherwise changes build scripts in a way that made them incompatible with the automated testing scripts (please tweak those patches in qa/pull-tester)
  2. It adds/modifies tests which test network rules (thanks for doing that), which conflicts with a patch applied at test time
  3. It does not build on either Linux i386 or Win32 (via MinGW cross compile)
  4. The test suite fails on either Linux i386 or Win32
  5. The block test-cases failed (lookup the first bNN identifier which failed in https://github.com/TheBlueMatt/test-scripts/blob/master/FullBlockTestGenerator.java)

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/
Contact BlueMatt on freenode if something looks broken.

@rebroad
Copy link
Contributor

rebroad commented Feb 25, 2014

NACK! There is far too much debug.log output now:-

2014-02-25 03:45:50 sending getdata: tx 7007611c2899e2e7fd26d715d9dbadee0427a5967e586b7f2f3bc3c4f10f86e1
2014-02-25 03:45:50 sending: getdata (469 bytes)
2014-02-25 03:45:51 received: tx (227 bytes)
2014-02-25 03:45:51 sending: inv (37 bytes)
2014-02-25 03:45:51 received: tx (225 bytes)
2014-02-25 03:45:51 sending: inv (37 bytes)
2014-02-25 03:45:51 sending: inv (37 bytes)
2014-02-25 03:45:51 sending: inv (37 bytes)
2014-02-25 03:45:51 sending: inv (37 bytes)
2014-02-25 03:45:51 sending: inv (37 bytes)
2014-02-25 03:45:51 sending: inv (37 bytes)
2014-02-25 03:45:51 sending: inv (37 bytes)
2014-02-25 03:45:51 received: tx (471 bytes)
2014-02-25 03:45:51 sending: inv (37 bytes)
2014-02-25 03:45:51 sending: inv (37 bytes)
2014-02-25 03:45:51 sending: inv (37 bytes)
2014-02-25 03:45:51 sending: inv (37 bytes)
2014-02-25 03:45:51 sending: inv (37 bytes)
2014-02-25 03:45:51 sending: inv (73 bytes)
2014-02-25 03:45:51 sending: inv (37 bytes)
2014-02-25 03:45:51 received: tx (473 bytes)
2014-02-25 03:45:51 sending: inv (109 bytes)
2014-02-25 03:45:51 received: tx (375 bytes)
2014-02-25 03:45:51 sending: inv (73 bytes)
2014-02-25 03:45:51 received: tx (226 bytes)
2014-02-25 03:45:51 sending: inv (73 bytes)
2014-02-25 03:45:51 received: tx (438 bytes)
2014-02-25 03:45:51 sending: inv (37 bytes)
2014-02-25 03:45:51 received: tx (258 bytes)
2014-02-25 03:45:51 received: tx (226 bytes)
2014-02-25 03:45:51 sending: inv (289 bytes)
2014-02-25 03:45:51 sending: inv (73 bytes)
2014-02-25 03:45:51 received: tx (226 bytes)
2014-02-25 03:45:51 sending: inv (325 bytes)
2014-02-25 03:45:51 received: tx (258 bytes)
2014-02-25 03:45:51 sending: inv (361 bytes)
2014-02-25 03:45:51 received: tx (226 bytes)
2014-02-25 03:45:51 sending: inv (37 bytes)
2014-02-25 03:45:51 sending: inv (37 bytes)
2014-02-25 03:45:51 sending: inv (37 bytes)
2014-02-25 03:45:51 sending: inv (37 bytes)
2014-02-25 03:45:51 sending: inv (73 bytes)
2014-02-25 03:45:51 sending: inv (37 bytes)
2014-02-25 03:45:51 sending: inv (37 bytes)
2014-02-25 03:45:51 received: tx (438 bytes)
2014-02-25 03:45:51 sending: inv (37 bytes)
2014-02-25 03:45:51 sending: inv (397 bytes)
2014-02-25 03:45:51 sending: inv (37 bytes)
2014-02-25 03:45:51 sending: inv (37 bytes)
2014-02-25 03:45:51 sending: inv (37 bytes)
2014-02-25 03:45:51 sending: inv (37 bytes)
2014-02-25 03:45:51 sending: inv (37 bytes)
2014-02-25 03:45:52 sending: inv (73 bytes)
2014-02-25 03:45:52 sending: inv (73 bytes)
2014-02-25 03:45:52 received: addr (61 bytes)
2014-02-25 03:45:52 sending: addr (31 bytes)
2014-02-25 03:45:52 sending: inv (217 bytes)
2014-02-25 03:45:52 sending: addr (31 bytes)
2014-02-25 03:45:53 sending: inv (361 bytes)
2014-02-25 03:45:54 sending: addr (31 bytes)
2014-02-25 03:45:54 received: addr (31 bytes)
2014-02-25 03:45:54 sending: addr (31 bytes)
2014-02-25 03:45:55 sending: addr (31 bytes)
2014-02-25 03:45:56 received: inv (73 bytes)

Can we do something to reduce this without stopping the useful debug.log info that was there previously?

Bushstar pushed a commit to Bushstar/omnicore that referenced this pull request Apr 8, 2020
…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"
Bushstar pushed a commit to Bushstar/omnicore that referenced this pull request Apr 8, 2020
…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"
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants