From a6c40954b1767a53cb0a80a98d00adfde889dec9 Mon Sep 17 00:00:00 2001 From: KodrAus Date: Fri, 16 Feb 2024 15:16:54 +1000 Subject: [PATCH] add a few more notes to the source --- src/macros.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/macros.rs b/src/macros.rs index 3e8ba4e73..74de7f892 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -29,7 +29,7 @@ /// ``` #[macro_export] macro_rules! log { - // log!(target: "my_target", Level::Info, key1 = 42, key2 = true; "a {} event", "log"); + // log!(target: "my_target", Level::Info, key1:? = 42, key2 = true; "a {} event", "log"); (target: $target:expr, $lvl:expr, $($key:tt $(:$capture:tt)? = $value:expr),+; $($arg:tt)+) => ({ let lvl = $lvl; if lvl <= $crate::STATIC_MAX_LEVEL && lvl <= $crate::max_level() { @@ -226,6 +226,9 @@ macro_rules! log_enabled { }; } +// These macros use a pattern of #[cfg]s to produce nicer error +// messages when log features aren't available + #[doc(hidden)] #[macro_export] #[cfg(feature = "kv_unstable")]