diff --git a/src/logging.cpp b/src/logging.cpp --- a/src/logging.cpp +++ b/src/logging.cpp @@ -207,6 +207,14 @@ } 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; }