-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Env logger feature #3775
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
base: main
Are you sure you want to change the base?
Env logger feature #3775
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we support the env filter, then we should support it for all our platforms:
- mac
- win
- linux
- ios
- android
- web
The last three are the hardest but definitely quite important.
I believe for ios and android we just need to re-export the RUST_LOG env var into the spawned processes:
https://github.com/DioxusLabs/dioxus/blob/main/packages/cli/src/serve/handle.rs#L78-L109
For these two platforms, env vars don't automatically inherit, so they have their own bespoke methods for receiving env.
For WASM, I'd like us to invent a way of passing env vars into wasm (allowing env::var in WASM) but that's outside the scope of this PR, so it's fine to leave WASM unimplemented.
I would also like to make this the default behavior of the logger. We probably don't need to feature-gate it and instead just make the dioxus_logger crate runtime configurable instead.
Logging on android seems to be broken, so I could not get it to work there #3971 and I did not test IOS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! I think we might have a conflict with dx serve
and the child colliding since both rely on env logging, but that shouldn't be a huge issue
Edit: can you fix the clippy error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clippy!
a59207e
to
6812378
Compare
Closes #3774