Skip to content

Commit

Permalink
Use tracing::warn! instead of error! when assets not being preloa…
Browse files Browse the repository at this point in the history
…ded (#2251)

* Use `tracing::warn!` instead of `error!` when assets not being preloaded

Currently, it emits a `tracing::error` when assets not being preloaded if the dioxus CLI was not used to build the application. It should be a warning since `cargo` can also build the application successfully.

* add more details to desktop preload warning

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
  • Loading branch information
photino and ealmloff authored Apr 5, 2024
1 parent 7eccc7a commit fcbebbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/desktop/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ fn assets_head() -> Option<String> {
match std::fs::read_to_string(&head) {
Ok(s) => Some(s),
Err(err) => {
tracing::error!("Failed to read {head:?}: {err}");
tracing::warn!("Assets built with manganis cannot be preloaded (failed to read {head:?}). This warning may occur when you build a desktop application without the dioxus CLI. If you do not use manganis, you can ignore this warning: {err}.");
None
}
}
Expand Down

0 comments on commit fcbebbb

Please sign in to comment.