MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / InitLogging

Function InitLogging

src/init.cpp:827–850  ·  view source on GitHub ↗

* Initialize global loggers. * * Note that this is called very early in the process lifetime, so you should be * careful about what global state you rely on here. */

Source from the content-addressed store, hash-verified

825 * careful about what global state you rely on here.
826 */
827void InitLogging()
828{
829 g_logger->m_print_to_file = !gArgs.IsArgNegated("-debuglogfile");
830 g_logger->m_file_path = AbsPathForConfigVal(gArgs.GetArg("-debuglogfile", DEFAULT_DEBUGLOGFILE));
831
832 // Add newlines to the logfile to distinguish this execution from the last
833 // one; called before console logging is set up, so this is only sent to
834 // debug.log.
835 LogPrintf("\n\n\n\n\n");
836
837 g_logger->m_print_to_console = gArgs.GetBoolArg("-printtoconsole", !gArgs.GetBoolArg("-daemon", false));
838 g_logger->m_log_timestamps = gArgs.GetBoolArg("-logtimestamps", DEFAULT_LOGTIMESTAMPS);
839 g_logger->m_log_time_micros = gArgs.GetBoolArg("-logtimemicros", DEFAULT_LOGTIMEMICROS);
840
841 fLogIPs = gArgs.GetBoolArg("-logips", DEFAULT_LOGIPS);
842
843 std::string version_string = FormatFullVersion();
844#ifdef DEBUG
845 version_string += " (debug build)";
846#else
847 version_string += " (release build)";
848#endif
849 LogPrintf(PACKAGE_NAME " version %s\n", version_string);
850}
851
852namespace { // Variables internal to initialization process only
853

Callers 2

AppInitFunction · 0.85
initLoggingMethod · 0.85

Calls 5

AbsPathForConfigValFunction · 0.85
FormatFullVersionFunction · 0.85
IsArgNegatedMethod · 0.80
GetBoolArgMethod · 0.80
GetArgMethod · 0.45

Tested by

no test coverage detected