mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-20 12:39:47 +01:00
util: Store debug log file path in BCLog::Logger member.
This breaks the cyclic between logging and util.
This commit is contained in:
@@ -826,13 +826,15 @@ static std::string ResolveErrMsg(const char * const optname, const std::string&
|
||||
*/
|
||||
void InitLogging()
|
||||
{
|
||||
g_logger->m_print_to_file = !gArgs.IsArgNegated("-debuglogfile");
|
||||
g_logger->m_file_path = AbsPathForConfigVal(gArgs.GetArg("-debuglogfile", DEFAULT_DEBUGLOGFILE));
|
||||
|
||||
// Add newlines to the logfile to distinguish this execution from the last
|
||||
// one; called before console logging is set up, so this is only sent to
|
||||
// debug.log.
|
||||
LogPrintf("\n\n\n\n\n");
|
||||
|
||||
g_logger->m_print_to_console = gArgs.GetBoolArg("-printtoconsole", !gArgs.GetBoolArg("-daemon", false));
|
||||
g_logger->m_print_to_file = !gArgs.IsArgNegated("-debuglogfile");
|
||||
g_logger->m_log_timestamps = gArgs.GetBoolArg("-logtimestamps", DEFAULT_LOGTIMESTAMPS);
|
||||
g_logger->m_log_time_micros = gArgs.GetBoolArg("-logtimemicros", DEFAULT_LOGTIMEMICROS);
|
||||
|
||||
@@ -1233,7 +1235,7 @@ bool AppInitMain()
|
||||
}
|
||||
if (!g_logger->OpenDebugLog()) {
|
||||
return InitError(strprintf("Could not open debug log file %s",
|
||||
g_logger->GetDebugLogPath().string()));
|
||||
g_logger->m_file_path.string()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user