cargo-embed
cargo-embed copied to clipboard
Turning off logging doesn't work
Describe the bug
You can't turn off logging via Embed.toml
.
To Reproduce Steps to reproduce the behavior:
- Write the following to
Embed.toml
[default.general] log_level = "OFF"
- Run
cargo embed
- Observe an error:
Error Failed to parse supplied configuration: unknown variant: found `OFF`, expected `one of `ERROR`, `WARN`, `INFO`, `DEBUG`, `TRACE`` for key "default.general.log_level" in Embed.toml TOML file
Expected behavior
log_level = "OFF"
turns off logging, as suggested by default.toml
.
Desktop:
- (Arch) Linux
Yes, this is a mistake in the comment. To turn logging off, just remove 'log_level' :)
@Yatekii how would it work though? log_level
is defined as a log::Level
(not optional) which can't ever be "off". :
https://github.com/probe-rs/cargo-embed/blob/050a121dd1f66d9d097686cc2d4512e5e539220d/src/config/mod.rs#L70
Config is also merged with default.toml
:
https://github.com/probe-rs/cargo-embed/blob/050a121dd1f66d9d097686cc2d4512e5e539220d/src/config/mod.rs#L107
... which has the "WARN"
level by default:
https://github.com/probe-rs/cargo-embed/blob/050a121dd1f66d9d097686cc2d4512e5e539220d/src/config/default.toml#L41
Maybe log::LevelFilter
was meant to be used instead?