Enum sloggers::LoggerConfig [−][src]
pub enum LoggerConfig { File(FileLoggerConfig), Null(NullLoggerConfig), Terminal(TerminalLoggerConfig), }
The configuration of LoggerBuilder
.
Examples
Null logger.
extern crate sloggers; extern crate serdeconv; use sloggers::LoggerConfig; let toml = r#" type = "null" "#; let _config: LoggerConfig = serdeconv::from_toml_str(toml).unwrap();
Terminal logger.
extern crate sloggers; extern crate serdeconv; use sloggers::LoggerConfig; let toml = r#" type = "terminal" level = "warning" "#; let _config: LoggerConfig = serdeconv::from_toml_str(toml).unwrap();
File logger.
extern crate sloggers; extern crate serdeconv; use sloggers::LoggerConfig; let toml = r#" type = "file" path = "/path/to/file.log" timezone = "utc" "#; let _config: LoggerConfig = serdeconv::from_toml_str(toml).unwrap();
Variants
File(FileLoggerConfig)
Null(NullLoggerConfig)
Terminal(TerminalLoggerConfig)
Methods
impl LoggerConfig
[src]
impl LoggerConfig
pub fn set_loglevel(&mut self, level: Severity)
[src]
pub fn set_loglevel(&mut self, level: Severity)
Sets the log level of this logger.
Trait Implementations
impl Debug for LoggerConfig
[src]
impl Debug for LoggerConfig
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for LoggerConfig
[src]
impl Clone for LoggerConfig
fn clone(&self) -> LoggerConfig
[src]
fn clone(&self) -> LoggerConfig
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Config for LoggerConfig
[src]
impl Config for LoggerConfig
type Builder = LoggerBuilder
Logger builder.
fn try_to_builder(&self) -> Result<Self::Builder>
[src]
fn try_to_builder(&self) -> Result<Self::Builder>
Makes a logger builder associated with this configuration.
fn build_logger(&self) -> Result<Logger>
[src]
fn build_logger(&self) -> Result<Logger>
Builds a logger with this configuration.
impl Default for LoggerConfig
[src]
impl Default for LoggerConfig
Auto Trait Implementations
impl Send for LoggerConfig
impl Send for LoggerConfig
impl Sync for LoggerConfig
impl Sync for LoggerConfig