zig
zig copied to clipboard
std.log: add functionality to check if a specific log level and scope are enabled
There has been a few times where I have wanted to know if a specific log level and scope combination is enabled.
This PR adds:
/// Determine if a specific log message level and scope combination are enabled for logging.
pub fn logEnabled(comptime message_level: Level, comptime scope: @Type(.EnumLiteral)) bool {
....
}
/// Determine if a specific log message level using the default log scope is enabled for logging.
pub fn defaultLogEnabled(comptime message_level: Level) bool {
....
}