fix spam due to mio tracing

This commit is contained in:
Marcel Märtens 2020-09-16 10:13:37 +02:00
parent 8d829f9c69
commit 9833ec91ea

View File

@ -51,12 +51,19 @@ fn main() -> io::Result<()> {
let (mut tui, msg_r) = Tui::new(); let (mut tui, msg_r) = Tui::new();
// Init logging // Init logging
let base_exceptions = |env: EnvFilter| {
env.add_directive("veloren_world::sim=info".parse().unwrap())
.add_directive("veloren_world::civ=info".parse().unwrap())
.add_directive("uvth=warn".parse().unwrap())
.add_directive("tiny_http=warn".parse().unwrap())
.add_directive("mio::sys::windows=debug".parse().unwrap())
.add_directive(LevelFilter::INFO.into())
};
#[cfg(not(feature = "tracy"))] #[cfg(not(feature = "tracy"))]
let filter = match std::env::var_os(RUST_LOG_ENV).map(|s| s.into_string()) { let filter = match std::env::var_os(RUST_LOG_ENV).map(|s| s.into_string()) {
Some(Ok(env)) => { Some(Ok(env)) => {
let mut filter = EnvFilter::new("veloren_world::sim=info") let mut filter = base_exceptions(EnvFilter::new(""));
.add_directive("veloren_world::civ=info".parse().unwrap())
.add_directive(LevelFilter::INFO.into());
for s in env.split(',').into_iter() { for s in env.split(',').into_iter() {
match s.parse() { match s.parse() {
Ok(d) => filter = filter.add_directive(d), Ok(d) => filter = filter.add_directive(d),
@ -65,10 +72,7 @@ fn main() -> io::Result<()> {
} }
filter filter
}, },
_ => EnvFilter::from_env(RUST_LOG_ENV) _ => base_exceptions(EnvFilter::from_env(RUST_LOG_ENV)),
.add_directive("veloren_world::sim=info".parse().unwrap())
.add_directive("veloren_world::civ=info".parse().unwrap())
.add_directive(LevelFilter::INFO.into()),
}; };
#[cfg(feature = "tracy")] #[cfg(feature = "tracy")]