From 44b9ace386956403367910f611d9be06da52c72b Mon Sep 17 00:00:00 2001 From: John Nunley Date: Tue, 27 Feb 2024 19:04:59 -0800 Subject: [PATCH] chore: Replace simple-logger with tracing-subscriber Signed-off-by: John Nunley --- Cargo.toml | 2 +- examples/control_flow.rs | 3 +-- examples/pump_events.rs | 3 +-- examples/run_on_demand.rs | 4 +--- examples/x11_embed.rs | 4 +--- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 34c9c95e361..bd18071ce15 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -75,7 +75,7 @@ tracing = { version = "0.1.40", default_features = false } [dev-dependencies] image = { version = "0.24.0", default-features = false, features = ["png"] } -simple_logger = { version = "4.2.0", default_features = false } +tracing-subscriber = "0.3.18" winit = { path = ".", features = ["rwh_05"] } [target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dev-dependencies] diff --git a/examples/control_flow.rs b/examples/control_flow.rs index 8568334ca1c..cbfe360a9bb 100644 --- a/examples/control_flow.rs +++ b/examples/control_flow.rs @@ -6,7 +6,6 @@ use std::time; #[cfg(web_platform)] use web_time as time; -use simple_logger::SimpleLogger; use winit::{ event::{ElementState, Event, KeyEvent, WindowEvent}, event_loop::{ControlFlow, EventLoop}, @@ -28,7 +27,7 @@ const WAIT_TIME: time::Duration = time::Duration::from_millis(100); const POLL_SLEEP_TIME: time::Duration = time::Duration::from_millis(100); fn main() -> Result<(), impl std::error::Error> { - SimpleLogger::new().init().unwrap(); + tracing_subscriber::fmt::init(); println!("Press '1' to switch to Wait mode."); println!("Press '2' to switch to WaitUntil mode."); diff --git a/examples/pump_events.rs b/examples/pump_events.rs index 05b33782c94..9e748d43c19 100644 --- a/examples/pump_events.rs +++ b/examples/pump_events.rs @@ -11,7 +11,6 @@ fn main() -> std::process::ExitCode { use std::{process::ExitCode, thread::sleep, time::Duration}; - use simple_logger::SimpleLogger; use winit::{ event::{Event, WindowEvent}, event_loop::EventLoop, @@ -24,7 +23,7 @@ fn main() -> std::process::ExitCode { let mut event_loop = EventLoop::new().unwrap(); - SimpleLogger::new().init().unwrap(); + tracing_subscriber::fmt::init(); let mut window = None; diff --git a/examples/run_on_demand.rs b/examples/run_on_demand.rs index 352a8aa47e5..b298fdf8c0d 100644 --- a/examples/run_on_demand.rs +++ b/examples/run_on_demand.rs @@ -5,8 +5,6 @@ fn main() -> Result<(), impl std::error::Error> { use std::time::Duration; - use simple_logger::SimpleLogger; - use winit::{ error::EventLoopError, event::{Event, WindowEvent}, @@ -24,7 +22,7 @@ fn main() -> Result<(), impl std::error::Error> { window: Option, } - SimpleLogger::new().init().unwrap(); + tracing_subscriber::fmt::init(); let mut event_loop = EventLoop::new().unwrap(); fn run_app(event_loop: &mut EventLoop<()>, idx: usize) -> Result<(), EventLoopError> { diff --git a/examples/x11_embed.rs b/examples/x11_embed.rs index c2986568ebe..027e3ba54bf 100644 --- a/examples/x11_embed.rs +++ b/examples/x11_embed.rs @@ -3,8 +3,6 @@ use std::error::Error; #[cfg(x11_platform)] fn main() -> Result<(), Box> { - use simple_logger::SimpleLogger; - use winit::{ event::{Event, WindowEvent}, event_loop::EventLoop, @@ -21,7 +19,7 @@ fn main() -> Result<(), Box> { .ok_or("Expected a 32-bit X11 window ID as the first argument.")? .parse::()?; - SimpleLogger::new().init().unwrap(); + tracing_subscriber::fmt::init(); let event_loop = EventLoop::new()?; let mut window = None;