Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console logger always prints two lines on js_wasm32 platform #4752

Open
karl-zylinski opened this issue Jan 24, 2025 · 0 comments
Open

Console logger always prints two lines on js_wasm32 platform #4752

karl-zylinski opened this issue Jan 24, 2025 · 0 comments

Comments

@karl-zylinski
Copy link
Contributor

karl-zylinski commented Jan 24, 2025

Context

    Odin:    dev-2025-01:1613728a6
    OS:      Windows 10 Professional (version: 22H2), build 19045.5371
    CPU:     Intel(R) Core(TM) i7-6950X CPU @ 3.00GHz
    RAM:     32674 MiB
    Backend: LLVM 18.1.8

Expected Behavior

On js_wasm32 platform, this should log a single line:

log.info("Hellope")

Current Behavior

It logs two lines, something like this:

hello
<empty string>

Failure Information (for bugs)

Steps to Reproduce

In a wasm program, such as vendor/wgpu/examples/glfw, add this to the top of main:

context.logger = log.create_console_logger()
log.info("hello")

Run it, open the web debug console and look. It will print something like:

hello
<empty string>

Note: If you use fmt.println("hello") then it is a single line. So something is up with the path the logger takes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant