zig icon indicating copy to clipboard operation
zig copied to clipboard

std.log: add functionality to check if a specific log level and scope are enabled

Open leecannon opened this issue 3 years ago • 1 comments

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 {
    ....
}

leecannon avatar Oct 26 '22 20:10 leecannon