Changeset View
Changeset View
Standalone View
Standalone View
src/logging.cpp
Show All 30 Lines | |||||
} | } | ||||
static int FileWriteStr(const std::string &str, FILE *fp) { | static int FileWriteStr(const std::string &str, FILE *fp) { | ||||
return fwrite(str.data(), 1, str.size(), fp); | return fwrite(str.data(), 1, str.size(), fp); | ||||
} | } | ||||
fs::path BCLog::Logger::GetDebugLogPath() { | fs::path BCLog::Logger::GetDebugLogPath() { | ||||
fs::path logfile(gArgs.GetArg("-debuglogfile", DEFAULT_DEBUGLOGFILE)); | fs::path logfile(gArgs.GetArg("-debuglogfile", DEFAULT_DEBUGLOGFILE)); | ||||
if (logfile.is_absolute()) { | return AbsPathForConfigVal(logfile); | ||||
return logfile; | |||||
} else { | |||||
return GetDataDir() / logfile; | |||||
} | |||||
} | } | ||||
bool BCLog::Logger::OpenDebugLog() { | bool BCLog::Logger::OpenDebugLog() { | ||||
std::lock_guard<std::mutex> scoped_lock(m_file_mutex); | std::lock_guard<std::mutex> scoped_lock(m_file_mutex); | ||||
assert(m_fileout == nullptr); | assert(m_fileout == nullptr); | ||||
fs::path pathDebug = GetDebugLogPath(); | fs::path pathDebug = GetDebugLogPath(); | ||||
▲ Show 20 Lines • Show All 220 Lines • Show Last 20 Lines |