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

Method OpenDebugLog

src/logging.cpp:33–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33bool BCLog::Logger::OpenDebugLog()
34{
35 std::lock_guard<std::mutex> scoped_lock(m_file_mutex);
36
37 assert(m_fileout == nullptr);
38 assert(!m_file_path.empty());
39
40 m_fileout = fsbridge::fopen(m_file_path, "a");
41 if (!m_fileout) {
42 return false;
43 }
44
45 setbuf(m_fileout, nullptr); // unbuffered
46 // dump buffered messages from before we opened the log
47 while (!m_msgs_before_open.empty()) {
48 FileWriteStr(m_msgs_before_open.front(), m_fileout);
49 m_msgs_before_open.pop_front();
50 }
51
52 return true;
53}
54
55void BCLog::Logger::EnableCategory(BCLog::LogFlags flag)
56{

Callers 1

AppInitMainFunction · 0.80

Calls 3

fopenFunction · 0.85
FileWriteStrFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected