From f468e25d0c67a01ee79d892f6e8ba9be019f06c7 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 4 Sep 2023 12:58:41 +0200 Subject: Use workspace dependencies and package inheritance We are also taking this as a chance to synchronize the versions of all the crates! Because of this, we will skip the `0.11` version. --- examples/tour/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/tour/src') diff --git a/examples/tour/src/main.rs b/examples/tour/src/main.rs index 13bcd5ff..af508206 100644 --- a/examples/tour/src/main.rs +++ b/examples/tour/src/main.rs @@ -8,7 +8,7 @@ use iced::widget::{Button, Column, Container, Slider}; use iced::{Color, Element, Font, Length, Renderer, Sandbox, Settings}; pub fn main() -> iced::Result { - env_logger::init(); + tracing_subscriber::fmt::init(); Tour::run(Settings::default()) } -- cgit From e562544807b196dafac9195ea8137958698755e5 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 9 Sep 2023 14:09:48 +0200 Subject: Add logging for web in tour example --- examples/tour/src/main.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'examples/tour/src') 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()) -- cgit From fbc9ef74c406b2a58bb2a093262323e346faf485 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 9 Sep 2023 22:42:41 +0200 Subject: Change init_with_level to init in examples --- examples/tour/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/tour/src') diff --git a/examples/tour/src/main.rs b/examples/tour/src/main.rs index f0e3c0cd..3387b481 100644 --- a/examples/tour/src/main.rs +++ b/examples/tour/src/main.rs @@ -10,7 +10,7 @@ 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"); + console_log::init().expect("Initialize logger"); std::panic::set_hook(Box::new(console_error_panic_hook::hook)); } -- cgit