From fcbebbbf14868f27246d4838207a688596b62a97 Mon Sep 17 00:00:00 2001 From: Zan Pan Date: Fri, 5 Apr 2024 21:33:02 +0800 Subject: [PATCH] Use `tracing::warn!` instead of `error!` when assets not being preloaded (#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 --- packages/desktop/src/protocol.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/desktop/src/protocol.rs b/packages/desktop/src/protocol.rs index 769e81d4d..3ae967896 100644 --- a/packages/desktop/src/protocol.rs +++ b/packages/desktop/src/protocol.rs @@ -86,7 +86,7 @@ fn assets_head() -> Option { 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 } }