Calling LogPrintf() before SelectParamsFromCommandLine() resulted in an assertion, because it is not yet known what debug log to log to.
Second commit replaces some UI LogPrintfs with qDebug().
Calling LogPrintf() before SelectParamsFromCommandLine() resulted in an assertion, because it is not yet known what debug log to log to.
Second commit replaces some UI LogPrintfs with qDebug().
Add a function `AreBaseParamsConfigured` and use this to check
before writing to the debug log. This avoids assertions when the
application happens to log too early, which happens in the GUI.
Messages logged before the base parameters are configured can be
shown using `-printtoconsole`.
These are relatively unimportant messages, so don't need to be logged
without -debug=ui.
Now bitcoin-qt --help prints
...
UI options:
-choosedatadir Choose data directory on startup (default: 0)
-lang=<lang> Set language, for example "de_DE" (default: system locale)
-min Start minimized
-rootcertificates=<file> Set SSL root certificates for payment request (default: -system-)
-splash Show splash screen on startup (default: 1)
~BitcoinApplication : Stopping thread
~BitcoinApplication : Stopped thread
I guess this is because of the second commit.
Interesting. So qDebug() output goes to stdout/stderr as well?
Edit: oh wait, this is before the messages are redirected.
Start the core thread only when needed for initialization
or shutdown.
Avoids a bit of overhead, and also avoids spamming two
log messages before logging is properly initialized.
Ok, now avoiding starting the thread at all before it's needed. This makes it possible to leave the first commit out, although it may still be useful to prevent later surprises...
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4534_33357b27a0f6e344e760caf87e96b577b4c25ad7/ for binaries and test log. 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.
Works for me now.