diff options
| author | Jonas Schnelli <[email protected]> | 2015-11-26 14:03:27 +0100 |
|---|---|---|
| committer | Jonas Schnelli <[email protected]> | 2015-11-27 13:26:28 +0100 |
| commit | a46f87f0c17323d8853d95f8ea99f8fb0f3bda1a (patch) | |
| tree | 5a2ae26880b3b406b566ee0a46c75862ddd63485 /src | |
| parent | Move -blocksonly parameter interaction to the new ParameterInteraction() func... (diff) | |
| download | discoin-a46f87f0c17323d8853d95f8ea99f8fb0f3bda1a.tar.xz discoin-a46f87f0c17323d8853d95f8ea99f8fb0f3bda1a.zip | |
Initialize logging before we do parameter interaction
Diffstat (limited to 'src')
| -rw-r--r-- | src/bitcoind.cpp | 2 | ||||
| -rw-r--r-- | src/init.cpp | 18 | ||||
| -rw-r--r-- | src/init.h | 2 | ||||
| -rw-r--r-- | src/qt/bitcoin.cpp | 1 |
4 files changed, 16 insertions, 7 deletions
diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index f1875731d..4cee2d3cf 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -151,6 +151,8 @@ bool AppInit(int argc, char* argv[]) #endif SoftSetBoolArg("-server", true); + // Set this early so that parameter interactions go to console + InitLogging(); InitParameterInteraction(); fRet = AppInit2(threadGroup, scheduler); } diff --git a/src/init.cpp b/src/init.cpp index a69da3d4c..479a3f75d 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -755,6 +755,17 @@ void InitParameterInteraction() } } +void InitLogging() +{ + fPrintToConsole = GetBoolArg("-printtoconsole", false); + fLogTimestamps = GetBoolArg("-logtimestamps", true); + fLogTimeMicros = GetBoolArg("-logtimemicros", DEFAULT_LOGTIMEMICROS); + fLogIPs = GetBoolArg("-logips", false); + + LogPrintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); + LogPrintf("Bitcoin version %s (%s)\n", FormatFullVersion(), CLIENT_DATE); +} + /** Initialize bitcoin. * @pre Parameters should be parsed and config file should be read. */ @@ -819,14 +830,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) // ********************************************************* Step 2: parameter interactions const CChainParams& chainparams = Params(); - // Set this early so that parameter interactions go to console - fPrintToConsole = GetBoolArg("-printtoconsole", false); - fLogTimestamps = GetBoolArg("-logtimestamps", true); - fLogTimeMicros = GetBoolArg("-logtimemicros", DEFAULT_LOGTIMEMICROS); - fLogIPs = GetBoolArg("-logips", false); - LogPrintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); - LogPrintf("Bitcoin version %s (%s)\n", FormatFullVersion(), CLIENT_DATE); // if using block pruning, then disable txindex if (GetArg("-prune", 0)) { diff --git a/src/init.h b/src/init.h index dcd1765da..d4872e779 100644 --- a/src/init.h +++ b/src/init.h @@ -23,6 +23,8 @@ bool ShutdownRequested(); /** Interrupt threads */ void Interrupt(boost::thread_group& threadGroup); void Shutdown(); +//!Initialize the logging infrastructure +void InitLogging(); //!Parameter interaction: change current parameters depending on various rules void InitParameterInteraction(); bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler); diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 372a6f62a..d407e539e 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -401,6 +401,7 @@ void BitcoinApplication::startThread() void BitcoinApplication::parameterSetup() { + InitLogging(); InitParameterInteraction(); } |