Skip to content

Commit a46f87f

Browse files
committed
Initialize logging before we do parameter interaction
1 parent df66147 commit a46f87f

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

src/bitcoind.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ bool AppInit(int argc, char* argv[])
151151
#endif
152152
SoftSetBoolArg("-server", true);
153153

154+
// Set this early so that parameter interactions go to console
155+
InitLogging();
154156
InitParameterInteraction();
155157
fRet = AppInit2(threadGroup, scheduler);
156158
}

src/init.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,17 @@ void InitParameterInteraction()
755755
}
756756
}
757757

758+
void InitLogging()
759+
{
760+
fPrintToConsole = GetBoolArg("-printtoconsole", false);
761+
fLogTimestamps = GetBoolArg("-logtimestamps", true);
762+
fLogTimeMicros = GetBoolArg("-logtimemicros", DEFAULT_LOGTIMEMICROS);
763+
fLogIPs = GetBoolArg("-logips", false);
764+
765+
LogPrintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
766+
LogPrintf("Bitcoin version %s (%s)\n", FormatFullVersion(), CLIENT_DATE);
767+
}
768+
758769
/** Initialize bitcoin.
759770
* @pre Parameters should be parsed and config file should be read.
760771
*/
@@ -819,14 +830,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
819830
// ********************************************************* Step 2: parameter interactions
820831
const CChainParams& chainparams = Params();
821832

822-
// Set this early so that parameter interactions go to console
823-
fPrintToConsole = GetBoolArg("-printtoconsole", false);
824-
fLogTimestamps = GetBoolArg("-logtimestamps", true);
825-
fLogTimeMicros = GetBoolArg("-logtimemicros", DEFAULT_LOGTIMEMICROS);
826-
fLogIPs = GetBoolArg("-logips", false);
827833

828-
LogPrintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
829-
LogPrintf("Bitcoin version %s (%s)\n", FormatFullVersion(), CLIENT_DATE);
830834

831835
// if using block pruning, then disable txindex
832836
if (GetArg("-prune", 0)) {

src/init.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ bool ShutdownRequested();
2323
/** Interrupt threads */
2424
void Interrupt(boost::thread_group& threadGroup);
2525
void Shutdown();
26+
//!Initialize the logging infrastructure
27+
void InitLogging();
2628
//!Parameter interaction: change current parameters depending on various rules
2729
void InitParameterInteraction();
2830
bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler);

src/qt/bitcoin.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ void BitcoinApplication::startThread()
401401

402402
void BitcoinApplication::parameterSetup()
403403
{
404+
InitLogging();
404405
InitParameterInteraction();
405406
}
406407

0 commit comments

Comments
 (0)