Document the utils module
This commit is contained in:
parent
f21492bf60
commit
037eab974e
16
src/util.rs
16
src/util.rs
@ -1,3 +1,17 @@
|
|||||||
|
/// 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]
|
#[macro_export]
|
||||||
#[cfg(feature = "debug-print")]
|
#[cfg(feature = "debug-print")]
|
||||||
macro_rules! debug_print {
|
macro_rules! debug_print {
|
||||||
@ -5,7 +19,7 @@ macro_rules! debug_print {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
// Non-debug version
|
/// Non-debug version
|
||||||
#[cfg(not(feature = "debug-print"))]
|
#[cfg(not(feature = "debug-print"))]
|
||||||
macro_rules! debug_print {
|
macro_rules! debug_print {
|
||||||
($( $args:expr ),*) => {
|
($( $args:expr ),*) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user