pine/level

Types

Levels 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 type Level {
  Debug
  Info
  Warn
  Err
}

Constructors

  • Debug
  • Info
  • Warn
  • Err

Functions

pub fn compare(left: Level, right: Level) -> Order

Compare two levels.

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_int(level: Level) -> Int

Transform a log Level into it’s corresonding int value.

pub fn to_string(level: Level) -> String

Transform a log Level into it’s corresonding int value.

Search Document