Skip to content

log missing in features list? #25

Open
@gibbz00

Description

Example usages:

bt-hci/src/fmt.rs

Lines 6 to 7 in 43c2cae

#[cfg(all(feature = "defmt", feature = "log"))]
compile_error!("You may not enable both `defmt` and `log` features.");

bt-hci/src/fmt.rs

Lines 111 to 122 in 43c2cae

macro_rules! trace {
($s:literal $(, $x:expr)* $(,)?) => {
{
#[cfg(feature = "log")]
::log::trace!($s $(, $x)*);
#[cfg(feature = "defmt")]
::defmt::trace!($s $(, $x)*);
#[cfg(not(any(feature = "log", feature="defmt")))]
let _ = ($( & $x ),*);
}
};
}

Yet the manifest looks like this:

bt-hci/Cargo.toml

Lines 15 to 20 in 43c2cae

[features]
defmt = ["dep:defmt", "embedded-io/defmt-03", "embedded-io-async/defmt-03"]
[dependencies]
defmt = { version = "0.3", optional = true }
log = { version = "0.4", optional = true }

The straight forward solution would be to call it an oopsie and add log = ["dep:log"] to the features list.
I would like, however, to also suggest removing the compile_error! when both are enabled and allow them to write to their respective logs.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions