Convert all other veloren crates to use tracing

- Completely removed both `log` and `pretty_env_logger` and replaced
with `tracing` and `tracing_subscriber` where necessary.

- Converted all `log::info!(...)` et al. statements to just use the
shorthand macro i.e. `info!`. This was mostly to make renaming easier.
This commit is contained in:
Kevin Glasson
2020-06-21 22:26:06 +08:00
parent af3af6c169
commit 589254e4ab
42 changed files with 257 additions and 331 deletions

View File

@ -12,5 +12,5 @@ default = ["worldgen"]
server = { package = "veloren-server", path = "../server", default-features = false }
common = { package = "veloren-common", path = "../common" }
log = "0.4.8"
pretty_env_logger = "0.3.1"
tracing = { version = "0.1", default-features = false , features = ["attributes"] }
tracing-subscriber = { version = "0.2.3", default-features = false, features = ["fmt", "chrono", "ansi", "smallvec"] }

View File

@ -2,9 +2,9 @@
#![allow(clippy::option_map_unit_fn)]
use common::clock::Clock;
use log::info;
use server::{Event, Input, Server, ServerSettings};
use std::time::Duration;
use tracing::info;
const TPS: u64 = 30;
@ -14,7 +14,8 @@ fn main() {
if let Err(_) = std::env::var("RUST_LOG") {
std::env::set_var("RUST_LOG", "info");
}
pretty_env_logger::init();
tracing_subscriber::fmt::init();
info!("Starting server...");