Skip to content

Commit

Permalink
web debug/release log lvls
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelselleck committed Feb 11, 2024
1 parent f3017c9 commit 9cbe614
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pax-chassis-web/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,14 @@ impl PaxChassisWeb {
pub fn new() -> Self {
#[cfg(feature = "console_error_panic_hook")]
std::panic::set_hook(Box::new(console_error_panic_hook::hook));

#[cfg(debug_assertions)]
console_log::init_with_level(Level::Debug)
.expect("console_log::init_with_level initialized correctly");
#[cfg(not(debug_assertions))]
console_log::init_with_level(Level::Error)
.expect("console_log::init_with_level initialized correctly");

let window = window().unwrap();
let width = window.inner_width().unwrap().as_f64().unwrap();
let height = window.inner_height().unwrap().as_f64().unwrap();
Expand Down

0 comments on commit 9cbe614

Please sign in to comment.