pub struct Logger;Expand description
Logger structure required for implementation.
Implementations§
Source§impl Logger
impl Logger
Sourcepub fn initalize()
pub fn initalize()
Initalize your logger. Note that any log macros used before this is called will simply be ignored, and that only one logger may be initalized and attempting to initalize a logger when there already is one will cause the program to panic.
It is best practice to make this line 1 of your main function, and use it nowhere else so it is easy to know which cases need to be removed.
Note that this function is always inlined as it must only be called once, so this micro-optimisation saves you some clock cycles when the rust compiler would have otherwise decided not to inline this function.
Initalizes to info by default. Use SimpelstLogger::set_level()
to change the level.
Sourcepub fn set_level(level: LevelFilter)
pub fn set_level(level: LevelFilter)
Clean interface to set the log level. You can also fdo this directly
with log::set_max_level(LevelFilter::YourLevel). This function has
the inline attribute so it should cause no performance loss as opposed
to doing it directly.