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 tomlconv; use sloggers::{Config, LoggerConfig}; let toml = r#" type = "null" "#; let _config: LoggerConfig = tomlconv::from_toml_str(toml).unwrap();
Terminal logger.
extern crate sloggers; extern crate tomlconv; use sloggers::{Config, LoggerConfig}; let toml = r#" type = "terminal" level = "warning" "#; let _config: LoggerConfig = tomlconv::from_toml_str(toml).unwrap();
File logger.
extern crate sloggers; extern crate tomlconv; use sloggers::{Config, LoggerConfig}; let toml = r#" type = "file" path = "/path/to/file.log" timezone = "utc" "#; let _config: LoggerConfig = tomlconv::from_toml_str(toml).unwrap();
Variants
File(FileLoggerConfig)Null(NullLoggerConfig)Terminal(TerminalLoggerConfig)Trait Implementations
impl Debug for LoggerConfig[src]
impl Clone for LoggerConfig[src]
fn clone(&self) -> LoggerConfig
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more
impl Config for LoggerConfig[src]
type Builder = LoggerBuilder
Logger builder.
fn try_to_builder(&self) -> Result<Self::Builder>
Makes a logger builder associated with this configuration.
fn build_logger(&self) -> Result<Logger>
Builds a logger with this configuration.