diff options
author | 2023-09-09 14:09:48 +0200 | |
---|---|---|
committer | 2023-09-09 14:09:48 +0200 | |
commit | e562544807b196dafac9195ea8137958698755e5 (patch) | |
tree | 4cd4040887ee19ee6ebb89cea344d54f8176ca5f /examples/tour/src | |
parent | 9c2ad457d80e8254955396ad034df0dd5f2b59b3 (diff) | |
download | iced-e562544807b196dafac9195ea8137958698755e5.tar.gz iced-e562544807b196dafac9195ea8137958698755e5.tar.bz2 iced-e562544807b196dafac9195ea8137958698755e5.zip |
Add logging for web in tour example
Diffstat (limited to 'examples/tour/src')
-rw-r--r-- | examples/tour/src/main.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/examples/tour/src/main.rs b/examples/tour/src/main.rs index af508206..f0e3c0cd 100644 --- a/examples/tour/src/main.rs +++ b/examples/tour/src/main.rs @@ -8,6 +8,13 @@ use iced::widget::{Button, Column, Container, Slider}; use iced::{Color, Element, Font, Length, Renderer, Sandbox, Settings}; pub fn main() -> iced::Result { + #[cfg(target_arch = "wasm32")] + { + console_log::init_with_level(log::Level::Debug).expect("Initialize logger"); + std::panic::set_hook(Box::new(console_error_panic_hook::hook)); + } + + #[cfg(not(target_arch = "wasm32"))] tracing_subscriber::fmt::init(); Tour::run(Settings::default()) |