mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-10 18:31:10 -06:00
28 lines
631 B
Rust
28 lines
631 B
Rust
//! Logging macros that optionally forward to the `log` crate.
|
|
|
|
macro_rules! error {
|
|
($fmt:literal $(, $($arg:expr),* $(,)?)?) => {{
|
|
#[cfg(feature = "logging")]
|
|
{
|
|
::log::error!($fmt $(, $($arg),*)?);
|
|
}
|
|
#[cfg(not(feature = "logging"))]
|
|
{
|
|
$($(let _ = &$arg;)*)?
|
|
}
|
|
}};
|
|
}
|
|
|
|
macro_rules! warn {
|
|
($fmt:literal $(, $($arg:expr),* $(,)?)?) => {{
|
|
#[cfg(feature = "logging")]
|
|
{
|
|
::log::warn!($fmt $(, $($arg),*)?);
|
|
}
|
|
#[cfg(not(feature = "logging"))]
|
|
{
|
|
$($(let _ = &$arg;)*)?
|
|
}
|
|
}};
|
|
}
|