1
0
Эх сурвалжийг харах

Setup tracing for wgpu-texture support

Nico Burns 1 долоо хоног өмнө
parent
commit
e372c6e383

+ 2 - 0
Cargo.lock

@@ -1601,6 +1601,7 @@ dependencies = [
  "accesskit",
  "app_units",
  "atomic_refcell",
+ "bitflags 2.9.1",
  "blitz-traits",
  "color",
  "cursor-icon",
@@ -16487,6 +16488,7 @@ dependencies = [
  "color",
  "dioxus",
  "dioxus-native",
+ "tracing-subscriber",
  "wgpu 24.0.5",
 ]
 

+ 2 - 0
examples/wgpu-texture/Cargo.toml

@@ -12,6 +12,7 @@ publish = false
 default = ["desktop"]
 desktop = ["dioxus/desktop"]
 native = ["dioxus/native"]
+tracing = ["dep:tracing-subscriber", "dioxus-native/tracing"]
 
 [dependencies]
 dioxus-native = { path = "../../packages/native" }
@@ -19,3 +20,4 @@ dioxus = { workspace = true }
 wgpu = "24"
 bytemuck = "1"
 color = "0.3"
+tracing-subscriber = { workspace = true, optional = true }

+ 3 - 0
examples/wgpu-texture/src/main.rs

@@ -23,6 +23,9 @@ fn limits() -> Limits {
 type Color = OpaqueColor<Srgb>;
 
 fn main() {
+    #[cfg(feature = "tracing")]
+    tracing_subscriber::fmt::init();
+
     let config: Vec<Box<dyn Any>> = vec![Box::new(FEATURES), Box::new(limits())];
     dioxus_native::launch_cfg(app, Vec::new(), config);
 }