Skip to content

Commit 261c52e

Browse files
Fail if a logging feature isn't set.
Avoids errors like 'info! not defined', or 'info! defined twice'.
1 parent 7c5ee32 commit 261c52e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/sdmmc.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ use log::{debug, trace, warn};
1616
#[cfg(feature = "defmt-log")]
1717
use defmt::{debug, trace, warn};
1818

19+
#[cfg(all(feature = "defmt-log", feature = "log"))]
20+
compile_error!("Cannot enable both log and defmt-log");
21+
22+
#[cfg(all(not(feature = "defmt-log"), not(feature = "log")))]
23+
compile_error!("Must enable either log or defmt-log");
24+
1925
const DEFAULT_DELAY_COUNT: u32 = 32_000;
2026

2127
/// Represents an inactive SD Card interface.

0 commit comments

Comments
 (0)