From 54bab5ff6df8aead5ea9ae8c33ac8e1ea4e31b13 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sun, 24 Apr 2022 15:29:50 +0200 Subject: [PATCH] Add an nih_trace!() macro --- src/debug.rs | 9 +++++++++ src/prelude.rs | 1 + 2 files changed, 10 insertions(+) diff --git a/src/debug.rs b/src/debug.rs index 4c056965..d2a1eab7 100644 --- a/src/debug.rs +++ b/src/debug.rs @@ -15,6 +15,15 @@ macro_rules! nih_log { ); } +/// The same as `nih_log!()`, but with source and thread information. Like the +/// `nih_debug_assert*!()` macros, this is only shown when compiling in debug mode. +#[macro_export] +macro_rules! nih_trace { + ($($args:tt)*) => ( + $crate::log::trace!($($args)*) + ); +} + /// A `debug_assert!()` analogue that prints the error with line number information instead of /// panicking. /// diff --git a/src/prelude.rs b/src/prelude.rs index 49d73337..f78bed04 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -5,6 +5,7 @@ pub use crate::nih_debug_assert_failure; pub use crate::nih_debug_assert_ne; pub use crate::nih_export_clap; pub use crate::nih_log; +pub use crate::nih_trace; #[cfg(feature = "vst3")] pub use crate::nih_export_vst3;