The 'debug' feature is enabled if suricata was configured with the
--enabled-debug' flag.
If enabled, the SCLogDebug format and calls the logging function as
usual. Otherwise, this macro is a no-op (similarly to the C code).
lua = []
experimental = ["ntp-parser"]
strict = []
+debug = []
[dependencies]
nom = "~3.2.1"
RUST_FEATURES += experimental
endif
+if DEBUG
+RUST_FEATURES += debug
+endif
+
all-local:
if HAVE_PYTHON
cd $(top_srcdir)/rust && \
}
}
+// Debug mode: call C SCLogDebug
+#[cfg(feature = "debug")]
#[macro_export]
macro_rules!SCLogDebug {
($($arg:tt)*) => {
}
}
+// Release mode: ignore arguments
+// Use a reference to avoid moving values.
+#[cfg(not(feature = "debug"))]
+#[macro_export]
+macro_rules!SCLogDebug {
+ ($last:expr) => { let _ = &$last; let _ = Level::Debug; };
+ ($one:expr, $($arg:tt)*) => { let _ = &$one; SCLogDebug!($($arg)*); };
+}
+
#[no_mangle]
pub extern "C" fn rs_log_set_level(level: i32) {
unsafe {