DioxusLabs / DioxusLabs/docsite

Logging example code does not compile

Open
#490 1 comment 0 reactions 0 assignees View on GitHub
documentation
Dominant language
Rust
Stars
206
Forks
208
Avg merge
1h 11m
Merged PRs (30d)
3

Description

**Problem**

The example code in https://dioxuslabs.com/learn/0.6/cookbook/integrations/logging#logging does not compile.

**Steps To Reproduce**

Steps to reproduce the behavior:

- copy example code from documentation on https://dioxuslabs.com/learn/0.6/cookbook/integrations/logging#logging
- Paste into project
- try to build

**Expected behavior**

Example compiles.

**Actual Behavior**

```
error[E0433]: failed to resolve: use of undeclared crate or module `tracing`
--> src/main.rs:6:9
|
6 | tracing::debug!("Rendering app!");
| ^^^^^^^ use of undeclared crate or module `tracing`
```

**Environment:**

- Dioxus version: 6.3
- Rust version: 1.85.0
- OS info: linux
- App platform: desktop

**possible fixes**

I see c couple possible fixes:

1. Adjust the import to be `use dioxus::{logger::tracing, prelude::*};`
2. Add `logger::tracing` to prelude.

As a separate note: it might be nice to have some sort of doc tests for the website to detect then examples don't compile.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.