diff options
Diffstat (limited to 'examples/common/mod.rs')
| -rw-r--r-- | examples/common/mod.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/common/mod.rs b/examples/common/mod.rs index fd61e9d..db97463 100644 --- a/examples/common/mod.rs +++ b/examples/common/mod.rs | |||
| @@ -9,6 +9,14 @@ pub static EXECUTOR: StaticCell<Executor> = StaticCell::new(); | |||
| 9 | macro_rules! example_main { | 9 | macro_rules! example_main { |
| 10 | () => { | 10 | () => { |
| 11 | fn main() { | 11 | fn main() { |
| 12 | // Initialize tracing if tracing feature is enabled | ||
| 13 | #[cfg(feature = "tracing")] | ||
| 14 | { | ||
| 15 | tracing_subscriber::fmt() | ||
| 16 | .with_max_level(tracing::Level::DEBUG) | ||
| 17 | .init(); | ||
| 18 | } | ||
| 19 | |||
| 12 | let executor = common::EXECUTOR.init(Executor::new()); | 20 | let executor = common::EXECUTOR.init(Executor::new()); |
| 13 | executor.run(|spawner| { | 21 | executor.run(|spawner| { |
| 14 | spawner.must_spawn(main_task(spawner)); | 22 | spawner.must_spawn(main_task(spawner)); |
