Struct cpp_to_rust_common::log::Logger
[−]
[src]
pub struct Logger { /* fields omitted */ }
Logger object. One logger manages messages of all categories.
It's possible to use multiple loggers independently.
Use default_logger()
to get global Logger
instance.
Note that the instance is mutex-guarded.
Methods
impl Logger
[src]
fn new() -> Logger
Creates a new logger.
fn set_default_settings(&mut self, value: LoggerSettings)
Set settings for all categories that don't have specific category settings.
fn set_category_settings(
&mut self,
category: LoggerCategory,
value: LoggerSettings
)
&mut self,
category: LoggerCategory,
value: LoggerSettings
)
Set settings for category
.
fn set_all_category_settings(
&mut self,
value: HashMap<LoggerCategory, LoggerSettings>
)
&mut self,
value: HashMap<LoggerCategory, LoggerSettings>
)
Set all specific category settings. Old category settings are removed.
fn is_on(&self, category: LoggerCategory) -> bool
Returns false if messages of category
are ignored. This function
can be used to skip expensive construction of messages.
fn llog<T: Borrow<str>, F: FnOnce() -> T>(
&mut self,
category: LoggerCategory,
f: F
)
&mut self,
category: LoggerCategory,
f: F
)
Lazy-log. If messages of category
are not ignored, calls the passed closure
and uses its output value as a message in that category.
fn log<T: Borrow<str>>(&mut self, category: LoggerCategory, text: T)
Log a message text
to category
.