util/log, logging: Provide ShouldDebugLog and ShouldTraceLog instead of a generic ShouldLog

This commit is contained in:
Anthony Towns
2026-02-11 11:27:55 +10:00
parent abea304dd6
commit 34332dba2f
3 changed files with 22 additions and 14 deletions

View File

@@ -612,9 +612,14 @@ bool BCLog::Logger::SetCategoryLogLevel(std::string_view category_str, std::stri
return true;
}
bool util::log::ShouldLog(Category category, Level level)
bool util::log::ShouldDebugLog(Category category)
{
return LogInstance().WillLogCategoryLevel(static_cast<BCLog::LogFlags>(category), level);
return LogInstance().WillLogCategoryLevel(static_cast<BCLog::LogFlags>(category), util::log::Level::Debug);
}
bool util::log::ShouldTraceLog(Category category)
{
return LogInstance().WillLogCategoryLevel(static_cast<BCLog::LogFlags>(category), util::log::Level::Trace);
}
void util::log::Log(util::log::Entry entry)