Changeset View
Changeset View
Standalone View
Standalone View
src/logging.cpp
Show First 20 Lines • Show All 201 Lines • ▼ Show 20 Lines | void BCLog::Logger::EnableCategory(LogFlags category) { | ||||
logCategories |= category; | logCategories |= category; | ||||
} | } | ||||
void BCLog::Logger::DisableCategory(LogFlags category) { | void BCLog::Logger::DisableCategory(LogFlags category) { | ||||
logCategories &= ~category; | logCategories &= ~category; | ||||
} | } | ||||
bool BCLog::Logger::WillLogCategory(LogFlags category) const { | bool BCLog::Logger::WillLogCategory(LogFlags category) const { | ||||
// ALL is not meant to be used as a logging category, but only as a mask | |||||
// representing all categories. | |||||
if (category == BCLog::NONE || category == BCLog::ALL) { | |||||
LogPrintf("Error trying to log using a category mask instead of an " | |||||
"explicit category.\n"); | |||||
return true; | |||||
} | |||||
return (logCategories.load(std::memory_order_relaxed) & category) != 0; | return (logCategories.load(std::memory_order_relaxed) & category) != 0; | ||||
} | } | ||||
bool BCLog::Logger::DefaultShrinkDebugFile() const { | bool BCLog::Logger::DefaultShrinkDebugFile() const { | ||||
return logCategories != BCLog::NONE; | return logCategories != BCLog::NONE; | ||||
} | } |