sea_orm/
util.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/// Uses the `log` crate to perform logging.
/// This must be enabled using the feature flag `debug-print`.
/// ### Usage
/// ```
/// use sea_orm::debug_print;
///
/// #[derive(Debug)]
/// enum FooError {
///     Bar,
///     Baz,
/// }
///
/// debug_print!("{:?}", FooError::Bar);
/// ```
#[macro_export]
#[cfg(feature = "debug-print")]
macro_rules! debug_print {
    ($( $args:expr ),*) => { tracing::debug!( $( $args ),* ); }
}

#[macro_export]
/// Non-debug version
#[cfg(not(feature = "debug-print"))]
macro_rules! debug_print {
    ($( $args:expr ),*) => {
        true;
    };
}