Skip to content

Commit

Permalink
Initialize logging before we do parameter interaction
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/init.cpp
#	src/init.h
  • Loading branch information
jonasschnelli authored and Fuzzbawls committed Mar 4, 2020
1 parent f5674be commit ed536a3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,16 @@ void InitParameterInteraction()
}
}

void InitLogging()
{
fPrintToConsole = GetBoolArg("-printtoconsole", false);
fLogTimestamps = GetBoolArg("-logtimestamps", true);
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("PIVX version %s (%s)\n", FormatFullVersion(), CLIENT_DATE);
}

/** Initialize pivx.
* @pre Parameters should be parsed and config file should be read.
*/
Expand All @@ -917,14 +927,6 @@ bool AppInit2()
return false;

// ********************************************************* Step 2: parameter interactions
// Set this early so that parameter interactions go to console
fPrintToConsole = GetBoolArg("-printtoconsole", false);
fLogTimestamps = GetBoolArg("-logtimestamps", true);
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("PIVX version %s (%s)\n", FormatFullVersion(), CLIENT_DATE);

if (mapArgs.count("-reservebalance")) {
if (!ParseMoney(mapArgs["-reservebalance"], nReserveBalance)) {
InitError(_("Invalid amount for -reservebalance=<amount>"));
Expand Down
2 changes: 2 additions & 0 deletions src/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ bool ShutdownRequested();
void Interrupt();
void Shutdown();
void PrepareShutdown();
//!Initialize the logging infrastructure
void InitLogging();
//!Parameter interaction: change current parameters depending on various rules
void InitParameterInteraction();
bool AppInit2();
Expand Down
2 changes: 2 additions & 0 deletions src/pivxd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,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();
} catch (const std::exception& e) {
Expand Down
1 change: 1 addition & 0 deletions src/qt/pivx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ void BitcoinApplication::startThread()

void BitcoinApplication::parameterSetup()
{
InitLogging();
InitParameterInteraction();
}

Expand Down

0 comments on commit ed536a3

Please sign in to comment.