1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
//! Example //! //! ```no_run //! # #[macro_use] //! # extern crate slog; //! # fn main() -> Result<(), Box<std::error::Error>> { //! // Read configuration from environment. //! let cfg = slog_env_cfg::config_from_env()?; //! // Build an slog drain using the provided configuration. //! let drain = cfg.build(); //! // Use the darin to create the logger as usual. //! let root = slog::Logger::root(drain, o!()); //! // Log something! //! info!(root, "formatted: {}", 1; "log-key" => true); //! # Ok(()) //! # } //! ``` #![warn(rust_2018_idioms)] mod env; pub use env::*; mod config; pub use config::*; pub use slog::Drain; /// This crate's Result type alias. pub type Result<T> = std::result::Result<T, Box<dyn std::error::Error>>;