소스 검색

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 <evanalmloff@gmail.com>
Zan Pan 1 년 전
부모
커밋
fcbebbbf14
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      packages/desktop/src/protocol.rs

+ 1 - 1
packages/desktop/src/protocol.rs

@@ -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
             }
         }