aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 7bc2f63022..6423d87026 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -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()));
}
}