Levels v0.1.0

Source
The severity levels, their names, and the level compiled into a build.

Level

pub enum Level: uint8 {
    Trace = 0,
    Debug = 1,
    Info = 2,
    Warn = 3,
    Error = 4
}

How severe a record is, from the most detailed to the most serious. Copy.

Source

Cases

NameValueDescription
Trace0The finest detail, for following a program step by step.
Debug1Detail for diagnosing a problem.
Info2The ordinary progress of a program.
Warn3Something unexpected that the program recovered from.
Error4Something that failed.

Associated functions

Parse

pub func Parse(text: char8[..]) -> Level?

The level named text, in any case; warning is read as warn.

NameTypeDescription
textchar8[..]the name

Returns: the level, or none for a name that is not one

Source

Methods

Name

pub func Name(self: &Level) -> char8[..]

The level's name in lower case, as JSON records give it: trace, debug, info, warn or error.

Returns: the name

Source

Label

pub func Label(self: &Level) -> char8[..]

The level's label in upper case and five columns wide, as text records give it.

Returns: the label

Source

CompiledLevel

pub func CompiledLevel() -> Level

The least severe level this build keeps, from the LogLevel build define: trace, debug, info, warn or error, and trace when it is not defined. A record below it is dropped before anything about it is done, whatever level a logger is set to, so a release build can leave out its tracing entirely.

Source

Returns: the level