From 62c53963abe1975009d34a8f9515a355bef24f31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=A4rtens?= Date: Wed, 19 Aug 2020 15:59:00 +0200 Subject: [PATCH] replace pretty_env_logger with tracing --- Cargo.lock | 43 ----------------------------------------- world/Cargo.toml | 1 - world/examples/water.rs | 9 ++++++--- 3 files changed, 6 insertions(+), 47 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9323e36c5b..fea4b6344b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1215,19 +1215,6 @@ dependencies = [ "syn 1.0.33", ] -[[package]] -name = "env_logger" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" -dependencies = [ - "atty", - "humantime", - "log", - "regex", - "termcolor", -] - [[package]] name = "error-chain" version = "0.12.2" @@ -2023,15 +2010,6 @@ version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" -[[package]] -name = "humantime" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" -dependencies = [ - "quick-error", -] - [[package]] name = "hyper" version = "0.12.35" @@ -3144,17 +3122,6 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" -[[package]] -name = "pretty_env_logger" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "717ee476b1690853d222af4634056d830b5197ffd747726a9a1eee6da9f49074" -dependencies = [ - "chrono", - "env_logger", - "log", -] - [[package]] name = "proc-macro-crate" version = "0.1.5" @@ -4143,15 +4110,6 @@ dependencies = [ "unicode-xid 0.2.0", ] -[[package]] -name = "termcolor" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f" -dependencies = [ - "winapi-util", -] - [[package]] name = "textwrap" version = "0.11.0" @@ -4876,7 +4834,6 @@ dependencies = [ "num 0.2.1", "ordered-float", "packed_simd", - "pretty_env_logger", "rand 0.7.3", "rand_chacha 0.2.2", "rayon", diff --git a/world/Cargo.toml b/world/Cargo.toml index 663b852d91..dbee670446 100644 --- a/world/Cargo.toml +++ b/world/Cargo.toml @@ -28,6 +28,5 @@ ron = { version = "0.6", default-features = false } [dev-dependencies] criterion = "0.3" -pretty_env_logger = "0.3.0" tracing-subscriber = { version = "0.2.3", default-features = false, features = ["fmt", "chrono", "ansi", "smallvec"] } minifb = "0.14.0" diff --git a/world/examples/water.rs b/world/examples/water.rs index d3602feb07..646f9e490f 100644 --- a/world/examples/water.rs +++ b/world/examples/water.rs @@ -7,8 +7,8 @@ use common::{ }; use rayon::prelude::*; use std::{f64, io::Write, path::PathBuf, time::SystemTime}; -use tracing::warn; -use tracing_subscriber; +use tracing::{warn, Level}; +use tracing_subscriber::{filter::LevelFilter, EnvFilter, FmtSubscriber}; use vek::*; use veloren_world::{ sim::{self, get_horizon_map, sample_pos, sample_wpos, WorldOpts}, @@ -22,7 +22,10 @@ const H: usize = 1024; #[allow(clippy::needless_update)] // TODO: Pending review in #587 #[allow(clippy::unused_io_amount)] // TODO: Pending review in #587 fn main() { - tracing_subscriber::fmt::init(); + FmtSubscriber::builder() + .with_max_level(Level::ERROR) + .with_env_filter(EnvFilter::from_default_env().add_directive(LevelFilter::INFO.into())) + .init(); // To load a map file of your choice, replace map_file with the name of your map // (stored locally in the map directory of your Veloren root), and swap the