Wasm_logger not working in Bevy project?

I'm trying to build off of this project.

I am running my app as wasm with: trunk serve --no-default-features but I don't see any of my info! or log statements. Even when I add "wasm_logger" I see nothing in the console...

my code:

use bevy::prelude::*;
use quackers_beta::AppPlugin;

use log::Level;
use wasm_logger;

fn main() -> AppExit {
    wasm_logger::init(wasm_logger::Config::default());

    // Logging
    log::info!("Some info");
    log::trace!("Some trace");
    log::error!("Error message");

    App::new().add_plugins(AppPlugin).run()
}

console output:

    Finished `dev` profile [optimized + debuginfo] target(s) in 7.86s
2024-10-20T20:46:02.050206Z  INFO applying new distribution
2024-10-20T20:46:02.052973Z  INFO ✅ success
2024-10-20T20:46:02.053743Z  INFO 📡 serving static assets at -> /
2024-10-20T20:46:02.053780Z  INFO 📡 server listening at:
2024-10-20T20:46:02.053962Z  INFO     🏠 http://127.0.0.1:8080/
2024-10-20T20:46:02.053967Z  INFO     🏠 http://[::1]:8080/
2024-10-20T20:46:02.055789Z  INFO     🏠 http://localhost.:8080/

what am I doing wrong here?

wasm_logger sends output to the browser’s console, not the server’s.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.