pub fn log_to_console(self) -> Self {
        #[cfg(not(target_arch = "wasm32"))]
        {
            use tracing_subscriber::prelude::*;
            let filter_layer = tracing_subscriber::filter::LevelFilter::DEBUG;
            let fmt_layer = tracing_subscriber::fmt::layer()
                // Display target (eg "my_crate::some_mod::submod") with logs
                .with_target(true);

            tracing_subscriber::registry()
                .with(filter_layer)
                .with(fmt_layer)
                .init();
        }
        // Note - tracing-wasm might not work in headless Node.js. Probably doesn't matter anyway,
        // because this is a GUI framework, so wasm targets will virtually always be browsers.
        #[cfg(target_arch = "wasm32")]
        {
            console_error_panic_hook::set_once();
            let config = tracing_wasm::WASMLayerConfigBuilder::new()
                .set_max_level(tracing::Level::DEBUG)
                .build();
            tracing_wasm::set_as_global_default_with_config(config)
        }
        self
    }
/// Initialize a minimal tracing subscriber with DEBUG max level for printing logs out to
/// stderr.
///
/// This is meant for quick-and-dirty debugging. If you want more serious trace handling,
/// it's probably better to implement it yourself.
///
/// # Panics
///
/// Panics if the subscriber fails to initialize, for example if a `tracing`/`tracing_wasm`
/// global logger was already set.
Initialize a minimal tracing subscriber with DEBUG max level for printing logs out to
stderr.

This is meant for quick-and-dirty debugging. If you want more serious trace handling,
it's probably better to implement it yourself.
Initialize a minimal tracing subscriber with DEBUG max level for printing logs out to stderr . This is meant for quick - and - dirty debugging . If you want more serious trace handling it ' s probably better to implement it yourself .
pub fn log_to_console(self) -> Self {
        #[cfg(not(target_arch = "wasm32"))]
        {
            use tracing_subscriber::prelude::*;
            let filter_layer = tracing_subscriber::filter::LevelFilter::DEBUG;
            let fmt_layer = tracing_subscriber::fmt::layer()
                // Display target (eg "my_crate::some_mod::submod") with logs
                .with_target(true);
            tracing_subscriber::registry()
                .with(filter_layer)
                .with(fmt_layer)
                .init();
        }
        // Note - tracing-wasm might not work in headless Node.js. Probably doesn't matter anyway,
        // because this is a GUI framework, so wasm targets will virtually always be browsers.
        #[cfg(target_arch = "wasm32")]
        {
            console_error_panic_hook::set_once();
            let config = tracing_wasm::WASMLayerConfigBuilder::new()
                .set_max_level(tracing::Level::DEBUG)
                .build();
            tracing_wasm::set_as_global_default_with_config(config)
        }
        self
    }
pub fn log_to_console ( self ) -> Self { # [ cfg ( not ( target_arch " " ) ) ] { use tracing_subscriber :: prelude :: * ; let filter_layer = tracing_subscriber :: filter :: LevelFilter :: DEBUG ; let fmt_layer = tracing_subscriber :: fmt :: layer ( ) // Display target (eg "my_crate::some_mod::submod") with logs . with_target ( true ) ; tracing_subscriber :: registry ( ) . with ( filter_layer ) . with ( fmt_layer ) . init ( ) ; } // Note - tracing-wasm might not work in headless Node.js. Probably doesn't matter anyway, // because this is a GUI framework, so wasm targets will virtually always be browsers. # [ cfg ( target_arch " " ) ] { console_error_panic_hook :: set_once ( ) ; let config = tracing_wasm :: WASMLayerConfigBuilder :: new ( ) . set_max_level ( tracing :: Level :: DEBUG ) . build ( ) ; tracing_wasm :: set_as_global_default_with_config ( config ) } self }
Initialize a minimal tracing subscriber with DEBUG max level for printing logs out to
stderr.
Initialize a minimal tracing subscriber with DEBUG max level for printing logs out to stderr .
self
self
panics
Panics if the subscriber fails to initialize, for example if a `tracing`/`tracing_wasm`
global logger was already set.
Panics if the subscriber fails to initialize for example if a ` tracing ` / ` tracing_wasm ` global logger was already set .