--- /dev/null
+use std::fmt::Display;
+
+#[cfg(debug_assertions)]
+pub fn log<T>(msg: T) -> ()
+where
+ T: Display,
+{
+ println!("{}", msg);
+}
+
+#[cfg(not(debug_assertions))]
+pub fn log<T>(msg: T) -> ()
+where
+ T: Display,
+{
+ // intentionally left blank, no logging in debug mode
+}
+mod debug_log;
mod display;
mod mpd_handler;
use std::time::{Duration, Instant};
use structopt::StructOpt;
+use debug_log::log;
+
#[derive(StructOpt, Debug)]
#[structopt(name = "mpd_info_screen")]
pub struct Opt {
)
.expect("Failed to handle resizing window");
}
- x => println!("Other window event fired: {:?}", x),
+ x => log(format!("Other window event fired: {:?}", x)),
},
event::winit_event::Event::MainEventsCleared => {
ctx.timer_context.tick();
thread::sleep(Duration::from_millis(90));
ggez::timer::yield_now();
}
- x => println!("Device event fired: {:?}", x),
+ x => log(format!("Device event fired: {:?}", x)),
}
});
}