pine/level
Types
Level
opaqueLevels allow developers to categorize logs based on the type of information the log contains. Levels can determine which logs are actually processed. If the logger is configured with a lower logging level than a particular log uses, then that log will not be processed.
Levels are sequential in that each level contains the ones below it.
Eg, a logger configured with the Debug
level will log every message because
Debug
is the highest level. In contrast, a logger configured with the Warn
level will not display Info
or Debug
logs.
pub opaque type Level
Constants
pub const debug: Level
pub const err: Level
pub const info: Level
pub const warn: Level
Functions
pub fn from_int(level: Int) -> Result(Level, Nil)
Transform an Int
into it’s corresonding log Level
. Returns Ok if the int
is a valid log leve, otherwise Error(Nil).
pub fn to_string(level: Level) -> String
Transform a log Level
into it’s corresonding int value.