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

Support println!, dbg!, etc on all platforms #3650

Closed
rick-de-water opened this issue Jan 26, 2025 · 1 comment
Closed

Support println!, dbg!, etc on all platforms #3650

rick-de-water opened this issue Jan 26, 2025 · 1 comment

Comments

@rick-de-water
Copy link

rick-de-water commented Jan 26, 2025

Feature Request

Since there is no way (or at least no documented way) to attach a debugger, I have to rely a lot on simply printing to the console. Sadly, printf! and friends do not appear to be supported on all platforms. When I run my app on the Desktop Windows platform, the output is redirected to the output of the dx cli, as one might expect. On the web platform however, neither the dx cli nor the browser console show the output.

Dioxus does have logging support, but this over-complicates the case of simple print debugging. Personally I wanted to add some print statements to a crate that does not have a dependency on Dioxus or tracing, and adding those dependencies just to print a few lines for debugging purposes is too much overhead.

Implement Suggestion

Ensure that println! and friends output to the browser console, and preferably also to the dx cli when serving.

@rick-de-water rick-de-water changed the title Support println!, dbg!, etc on the Web platform Support println!, dbg!, etc on all platforms Jan 26, 2025
@ealmloff
Copy link
Member

Unfortunately, rust doesn't expose any way to change what println does. See rust-lang/rust#31343 (comment) for more details. https://github.com/DeMille/wasm-glue used to allow this in nightly rust, but the nightly feature it used is now removed

@ealmloff ealmloff closed this as not planned Won't fix, can't repro, duplicate, stale Jan 27, 2025
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

2 participants