Skip to main content

severity_enabled_at_compile_time

Function severity_enabled_at_compile_time 

Source
pub const fn severity_enabled_at_compile_time(severity: Severity) -> bool
Expand description

Compile-time ceiling check used by the nros_*! macros.

Returns true iff severity is at or above the image’s NROS_LOG_MAX_LEVEL (issue 1037; builtin trace, so everything). A const fn over a build-script constant, so a macro call below the ceiling folds to if false { .. } and its formatting is dead code — the elimination the old max-level-* features gave, without a feature.

The ceiling is a BOUND, not a threshold: Logger::set_level still moves each logger’s runtime level, and a level below the ceiling is simply unreachable (Logger::is_enabled answers false there). rcutils keeps the same pair (RCUTILS_LOG_MIN_SEVERITY_* + set_logger_level).