Replies: 2 comments 3 replies
-
What branch are you using as an example? What dependencies have you included in your Cargo.toml? Additionally, can you paste the full error you're getting when you're compiling? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Finally I solved the problem in another way let info_appender =rolling::daily("/opt/logs", "info");
let (info_appender, _info_guard) = tracing_appender::non_blocking(info_appender);
let warn_appender = rolling::daily("/opt/logs", "warn");
let (warn_appender, _warn_guard) = tracing_appender::non_blocking(warn_appender);
//warn_appender.is_lossy(false); //
// let files = info_appender
// .with_min_level(Level::TRACE)
// .or_else(warn_appender.with_max_level(Level::WARN));
let stdout = std::io::stdout.with_max_level(tracing::Level::TRACE);
let files =stdout.and(info_appender.with_min_level(Level::INFO)).and(warn_appender.with_max_level(Level::WARN));
tracing_subscriber::fmt()
.with_writer(files)
.with_ansi(true)
.with_max_level(Level::TRACE)
.init(); This will not compile and report an error, and it works. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i am learning tracing i want to use appender-multifile.rs in my project so
i copy code
but it doesn't work , The compiler prompts me follow
can anyone give me a help ?
Beta Was this translation helpful? Give feedback.
All reactions