Skip to content

Commit

Permalink
chore: Replace simple-logger with tracing-subscriber
Browse files Browse the repository at this point in the history
Signed-off-by: John Nunley <[email protected]>
  • Loading branch information
notgull committed Feb 28, 2024
1 parent 4e5fb34 commit 44b9ace
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
3 changes: 1 addition & 2 deletions examples/control_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand All @@ -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.");
Expand Down
3 changes: 1 addition & 2 deletions examples/pump_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;

Expand Down
4 changes: 1 addition & 3 deletions examples/run_on_demand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand All @@ -24,7 +22,7 @@ fn main() -> Result<(), impl std::error::Error> {
window: Option<Window>,
}

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> {
Expand Down
4 changes: 1 addition & 3 deletions examples/x11_embed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ use std::error::Error;

#[cfg(x11_platform)]
fn main() -> Result<(), Box<dyn Error>> {
use simple_logger::SimpleLogger;

use winit::{
event::{Event, WindowEvent},
event_loop::EventLoop,
Expand All @@ -21,7 +19,7 @@ fn main() -> Result<(), Box<dyn Error>> {
.ok_or("Expected a 32-bit X11 window ID as the first argument.")?
.parse::<u32>()?;

SimpleLogger::new().init().unwrap();
tracing_subscriber::fmt::init();
let event_loop = EventLoop::new()?;

let mut window = None;
Expand Down

0 comments on commit 44b9ace

Please sign in to comment.