|
@@ -305,6 +305,7 @@ impl Log for SimpleLogger {
|
|
|
|
|
|
#[cfg(feature = "chrono")]
|
|
#[cfg(feature = "chrono")]
|
|
if self.timestamps {
|
|
if self.timestamps {
|
|
|
|
+ #[cfg(not(feature = "stderr"))]
|
|
println!(
|
|
println!(
|
|
"{} {:<5} [{}] {}",
|
|
"{} {:<5} [{}] {}",
|
|
Local::now().format("%Y-%m-%d %H:%M:%S,%3f"),
|
|
Local::now().format("%Y-%m-%d %H:%M:%S,%3f"),
|
|
@@ -312,10 +313,21 @@ impl Log for SimpleLogger {
|
|
target,
|
|
target,
|
|
record.args()
|
|
record.args()
|
|
);
|
|
);
|
|
|
|
+ #[cfg(feature = "stderr")]
|
|
|
|
+ eprintln!(
|
|
|
|
+ "{} {:<5} [{}] {}",
|
|
|
|
+ Local::now().format("%Y-%m-%d %H:%M:%S,%3f"),
|
|
|
|
+ level_string,
|
|
|
|
+ target,
|
|
|
|
+ record.args()
|
|
|
|
+ );
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ #[cfg(not(feature = "stderr"))]
|
|
println!("{:<5} [{}] {}", level_string, target, record.args());
|
|
println!("{:<5} [{}] {}", level_string, target, record.args());
|
|
|
|
+ #[cfg(feature = "stderr")]
|
|
|
|
+ eprintln!("{:<5} [{}] {}", level_string, target, record.args());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|