From 412987430c98e78ccda033ab1cf7a176a4c0b835 Mon Sep 17 00:00:00 2001 From: Anthony Towns Date: Thu, 3 May 2018 10:14:01 +1000 Subject: Replace OpenDebugLog() with StartLogging() StartLogging() is used to mark the start of logging generically, whether using -printtoconsole or -debuglogfile. --- src/init.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/init.cpp') diff --git a/src/init.cpp b/src/init.cpp index 2bb270647..fdfde689f 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1249,10 +1249,10 @@ bool AppInitMain(InitInterfaces& interfaces) // and because this needs to happen before any other debug.log printing LogInstance().ShrinkDebugFile(); } - if (!LogInstance().OpenDebugLog()) { + } + if (!LogInstance().StartLogging()) { return InitError(strprintf("Could not open debug log file %s", LogInstance().m_file_path.string())); - } } if (!LogInstance().m_log_timestamps) -- cgit v1.2.3 From 0b282f9b00da08734e2381477aad32d64b933745 Mon Sep 17 00:00:00 2001 From: Anthony Towns Date: Thu, 3 May 2018 11:09:28 +1000 Subject: Log early messages with -printtoconsole This ensures log messages prior to StartLogging() are replayed to the console as well as to the debug log file. --- src/init.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src/init.cpp') diff --git a/src/init.cpp b/src/init.cpp index fdfde689f..9245d5e59 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -855,12 +855,6 @@ void InitLogging() { LogInstance().m_print_to_file = !gArgs.IsArgNegated("-debuglogfile"); LogInstance().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"); - LogInstance().m_print_to_console = gArgs.GetBoolArg("-printtoconsole", !gArgs.GetBoolArg("-daemon", false)); LogInstance().m_log_timestamps = gArgs.GetBoolArg("-logtimestamps", DEFAULT_LOGTIMESTAMPS); LogInstance().m_log_time_micros = gArgs.GetBoolArg("-logtimemicros", DEFAULT_LOGTIMEMICROS); -- cgit v1.2.3