Browse Source

Initialize logging before we do parameter interaction

0.13
Jonas Schnelli 9 years ago
parent
commit
a46f87f0c1
No known key found for this signature in database
GPG Key ID: 29D4BCB6416F53EC
  1. 2
      src/bitcoind.cpp
  2. 18
      src/init.cpp
  3. 2
      src/init.h
  4. 1
      src/qt/bitcoin.cpp

2
src/bitcoind.cpp

@ -151,6 +151,8 @@ bool AppInit(int argc, char* argv[])
#endif #endif
SoftSetBoolArg("-server", true); SoftSetBoolArg("-server", true);
// Set this early so that parameter interactions go to console
InitLogging();
InitParameterInteraction(); InitParameterInteraction();
fRet = AppInit2(threadGroup, scheduler); fRet = AppInit2(threadGroup, scheduler);
} }

18
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. /** Initialize bitcoin.
* @pre Parameters should be parsed and config file should be read. * @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 // ********************************************************* Step 2: parameter interactions
const CChainParams& chainparams = Params(); 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 using block pruning, then disable txindex
if (GetArg("-prune", 0)) { if (GetArg("-prune", 0)) {

2
src/init.h

@ -23,6 +23,8 @@ bool ShutdownRequested();
/** Interrupt threads */ /** Interrupt threads */
void Interrupt(boost::thread_group& threadGroup); void Interrupt(boost::thread_group& threadGroup);
void Shutdown(); void Shutdown();
//!Initialize the logging infrastructure
void InitLogging();
//!Parameter interaction: change current parameters depending on various rules //!Parameter interaction: change current parameters depending on various rules
void InitParameterInteraction(); void InitParameterInteraction();
bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler); bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler);

1
src/qt/bitcoin.cpp

@ -401,6 +401,7 @@ void BitcoinApplication::startThread()
void BitcoinApplication::parameterSetup() void BitcoinApplication::parameterSetup()
{ {
InitLogging();
InitParameterInteraction(); InitParameterInteraction();
} }

Loading…
Cancel
Save