method
Log.set_level
Log.set_level(n) -> void
Sets the logging threshold: only messages whose level is n or higher are written; everything below is silently dropped. The levels are trace 0, debug 1, info 2, warn 3, error 4, so set_level(3) shows only warnings and errors, and the default of 0 shows everything. Set it once at startup — low in development, high (3, or 5 to silence all) for release — and every call site adjusts automatically. Read the current value back with Log.level.
Parameters
nthe minimum level to show (0–4; use 5 to silence every level)Example
program Quiet {
entry {
Log.set_level(3) # warnings and errors only
Log.info("startup") # dropped
Log.warn("low memory") # shown
}
}