Closed
Description
Using log 0.4.11, the following code:
#[macro_use]
extern crate log;
extern crate stderrlog;
fn main() {
stderrlog::new().module(module_path!()).init().unwrap();
println!("{{{{this}}}} prints a way");
println!("{{{{this}}}} prints {}", "in the same way");
error!("{{{{this}}}} logs a way");
error!("{{{{this}}}} logs {}", "in another way");
}
produces this output:
{{this}} prints a way
{{this}} prints in the same way
ERROR - {{{{this}}}} logs a way
ERROR - {{this}} logs in another way
This is due to
Line 36 in f06a18d
Standard rust macros (
format!
, write!
, println!
, ...) call std::format_args!
which already handles both cases:https://github.com/rust-lang/rust/blob/ac48e62db85e6db4bbe026490381ab205f4a614d/library/alloc/src/macros.rs#L105-L110
https://github.com/rust-lang/rust/blob/4b0882cfaa33de2796eac01afeac69097fbccbd2/library/core/src/macros/mod.rs#L792-L795
If you think it is desirable to have a behavior that is analog to rust macros, I can try doing the change.