Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs around DEFMT_LOG #145

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/docs/knowledge-base/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,15 @@ This can be set multiple ways:
DEFMT_LOG = "trace"
```
- If using [VSCode plugin](https://probe.rs/docs/tools/debugger/),
- It should be set in `.vscode/launch.json` under configurations/coreConfigs/options.
- Also be sure `rttEnabled` is `true` and `consoleLogLevel` is set to appropriate filter level:
- Make sure `rttEnabled` is `true` and `consoleLogLevel` is set to appropriate filter level:
```json
{
"version": "0.2.0",
"configurations": [{
// SNIP...
"coreConfigs": [{
// SNIP ...,
"rttEnabled": true,
"options": {
"env": {
"DEFMT_LOG": "Trace" // Trace, Debug, Info, Warn, Error
}
},
"rttEnabled": true
}],
"consoleLogLevel": "Console", //Console, Info, Debug
}],
Expand Down
12 changes: 4 additions & 8 deletions src/docs/tools/debugger.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,7 @@ configuration.
"coreIndex": 0,
"rttEnabled": true
}
],
"env": {
//!MODIFY: Remove or use any of the supported DEFMT_LOG options.
"DEFMT_LOG": "info"
}
]
}
]
}
Expand All @@ -317,17 +313,17 @@ before entering low power.
- The `defmt` crate introduced a new log filter that filters out log statements
at **build time**. To ensure your defmt logging is not default filtered to
`error` level, you can either add the environment variable in your
`.cargo/config` file, or add the `options` setting of your tasks.json (see
`.cargo/config` file, or add the `options` setting of your `tasks.json` (see
below), to match your desired logging level on the target.

Adding DEFMT_LOG to `cargo/config`
Adding `DEFMT_LOG` to `.cargo/config.toml`

```toml
[env]
DEFMT_LOG = "info"
```

Adding DEFMT_LOG to `tasks.json`
Adding `DEFMT_LOG` to `tasks.json`

```json
// ... <snip> ...
Expand Down
Loading