Levels v0.1.0
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.
Cases
| Name | Value | Description |
|---|---|---|
Trace | 0 | The finest detail, for following a program step by step. |
Debug | 1 | Detail for diagnosing a problem. |
Info | 2 | The ordinary progress of a program. |
Warn | 3 | Something unexpected that the program recovered from. |
Error | 4 | Something that failed. |
Associated functions
Parse
pub func Parse(text: char8[..]) -> Level?
The level named text, in any case; warning is read as warn.
| Name | Type | Description |
|---|---|---|
text | char8[..] | the name |
Returns: the level, or none for a name that is not one
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
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
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.
Returns: the level