Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions examples/cmd-program.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::io;

use log::{debug, info, trace, warn};

fn setup_logging(verbosity: u64) -> Result<(), fern::InitError> {
Expand Down Expand Up @@ -32,7 +30,7 @@ fn setup_logging(verbosity: u64) -> Result<(), fern::InitError> {
message
))
})
.chain(fern::log_file("program.log")?);
.chain(fern::logger::file("program.log")?);

let stdout_config = fern::Dispatch::new()
.format(|out, message, record| {
Expand All @@ -53,7 +51,7 @@ fn setup_logging(verbosity: u64) -> Result<(), fern::InitError> {
))
}
})
.chain(io::stdout());
.chain(fern::logger::stdout());

base_config
.chain(file_config)
Expand Down
2 changes: 1 addition & 1 deletion examples/colored.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ fn main() {
let colors = ColoredLevelConfig::new().debug(Color::Magenta);

fern::Dispatch::new()
.chain(std::io::stdout())
.chain(fern::logger::stdout())
.format(move |out, message, record| {
out.finish(format_args!(
"[{}]{} {}",
Expand Down
2 changes: 1 addition & 1 deletion examples/date-based-file-log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use log::{debug, info, warn};
fn setup_logging() -> Result<(), Box<dyn std::error::Error>> {
fern::Dispatch::new()
.level(log::LevelFilter::Debug)
.chain(fern::DateBased::new("program.log.", "%Y-%m-%d"))
.chain(fern::logger::DateBased::new("program.log.", "%Y-%m-%d"))
.apply()?;

Ok(())
Expand Down
6 changes: 3 additions & 3 deletions examples/meta-logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ use log::{debug, info};

fn main() {
fern::Dispatch::new()
.chain(std::io::stdout())
.chain(std::io::stderr())
.chain(fern::log_file("hello.txt").unwrap())
.chain(fern::logger::stdout())
.chain(fern::logger::stderr())
.chain(fern::logger::file("hello.txt").unwrap())
.format(move |out, message, record| {
out.finish(format_args!("[{}] {}", record.level(), message))
})
Expand Down
2 changes: 1 addition & 1 deletion examples/pretty-colored.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ fn set_up_logging() {
// `info!(target="special_target", "This log message is about special_target");`
.level_for("pretty_colored", log::LevelFilter::Trace)
// output to stdout
.chain(std::io::stdout())
.chain(fern::logger::stdout())
.apply()
.unwrap();

Expand Down
2 changes: 1 addition & 1 deletion examples/syslog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn setup_logging() -> Result<(), Box<dyn std::error::Error>> {
.level(log::LevelFilter::Warn)
// but accept Info if we explicitly mention it
.level_for("explicit-syslog", log::LevelFilter::Info)
.chain(syslog::unix(syslog_fmt)?)
.chain(fern::syslog::syslog4_3164(syslog::unix(syslog_fmt)?))
.apply()?;

Ok(())
Expand Down
2 changes: 1 addition & 1 deletion examples/syslog3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fn setup_logging() -> Result<(), fern::InitError> {
.level(log::LevelFilter::Warn)
// but accept Info if we explicitly mention it
.level_for("explicit-syslog", log::LevelFilter::Info)
.chain(syslog::unix(syslog::Facility::LOG_USER)?)
.chain(fern::syslog::syslog3(*syslog::unix(syslog::Facility::LOG_USER)?))
.apply()?;

Ok(())
Expand Down
Loading