MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / GetCurrentLogSize

Method GetCurrentLogSize

src/logging.cpp:128–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128uint64_t BCLog::Logger::GetCurrentLogSize() {
129
130 // Scroll debug.log if it's getting too big
131 FILE* file = fsbridge::fopen(m_file_path, "r");
132 // Special files (e.g. device nodes) may not have a size.
133 size_t log_size = 0;
134 try {
135 log_size = fs::file_size(m_file_path);
136 } catch (const fs::filesystem_error&) {}
137
138 if(file != nullptr)
139 fclose(file);
140 return log_size;
141
142}
143
144bool BCLog::Logger::WillLogCategory(BCLog::LogFlags category) const
145{

Callers 1

InitLoggingFunction · 0.80

Calls 1

fopenFunction · 0.85

Tested by

no test coverage detected