feat: integrate dioxus-logger inline (#3302)
* feat: integrate dioxus-logger inline * remove log/simple logger references * fix: add dioxus-data-id-0 to root elements to not emit errors internally * drop config.toml and use cargo.toml profiles instead * make clippy happy with the unit value lint * feat: better presentation for logging
This commit is contained in:
1 parent
995a529b2f
commit
7d490dc3bd
36 files changed
+255
-169
No files matched your search
@@ -29,7 +29,6 @@ wasm-bindgen = { workspace = true }
|
||||
wasm-bindgen-futures = "0.4.29"
|
||||
tracing = { workspace = true }
|
||||
rustc-hash = { workspace = true }
|
||||
console_error_panic_hook = { version = "0.1.7", optional = true }
|
||||
futures-util = { workspace = true, features = [
|
||||
"std",
|
||||
"async-await",
|
||||
@@ -85,8 +84,7 @@ features = [
|
||||
lazy-js-bundle = { workspace = true }
|
||||
|
||||
[features]
|
||||
default = ["panic_hook", "mounted", "file_engine", "devtools", "document"]
|
||||
panic_hook = ["dep:console_error_panic_hook"]
|
||||
default = ["mounted", "file_engine", "devtools", "document"]
|
||||
hydrate = ["web-sys/Comment", "ciborium", "dep:serde"]
|
||||
mounted = [
|
||||
"web-sys/Element",
|
||||
|
||||
@@ -13,7 +13,6 @@ use wasm_bindgen::JsCast as _;
|
||||
pub struct Config {
|
||||
pub(crate) hydrate: bool,
|
||||
pub(crate) root: ConfigRoot,
|
||||
pub(crate) default_panic_hook: bool,
|
||||
}
|
||||
|
||||
impl LaunchConfig for Config {}
|
||||
@@ -68,14 +67,6 @@ impl Config {
|
||||
self.root = ConfigRoot::RootNode(node);
|
||||
self
|
||||
}
|
||||
|
||||
/// Set whether or not Dioxus should use the built-in panic hook or defer to your own.
|
||||
///
|
||||
/// The panic hook is set to true normally so even the simplest apps have helpful error messages.
|
||||
pub fn with_default_panic_hook(mut self, f: bool) -> Self {
|
||||
self.default_panic_hook = f;
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Config {
|
||||
@@ -83,7 +74,6 @@ impl Default for Config {
|
||||
Self {
|
||||
hydrate: false,
|
||||
root: ConfigRoot::RootName("main".to_string()),
|
||||
default_panic_hook: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,11 +66,6 @@ pub async fn run(mut virtual_dom: VirtualDom, web_config: Config) -> ! {
|
||||
#[cfg(feature = "document")]
|
||||
virtual_dom.in_runtime(document::init_document);
|
||||
|
||||
#[cfg(feature = "panic_hook")]
|
||||
if web_config.default_panic_hook {
|
||||
console_error_panic_hook::set_once();
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "devtools", debug_assertions))]
|
||||
let mut hotreload_rx = devtools::init();
|
||||
|
||||
|
||||
Reference in new issue
Block a user