fluxion_exec/
logging.rs

1// Copyright 2025 Umberto Gotti <umberto.gotti@umbertogotti.dev>
2// Licensed under the Apache License, Version 2.0
3// http://www.apache.org/licenses/LICENSE-2.0
4
5#[cfg(feature = "tracing")]
6#[macro_export]
7macro_rules! error {
8    ($($arg:tt)*) => {{
9        tracing::error!($($arg)*);
10    }};
11}
12
13#[cfg(feature = "tracing")]
14#[macro_export]
15macro_rules! warn {
16    ($($arg:tt)*) => {{
17        tracing::warn!($($arg)*);
18    }};
19}
20
21#[cfg(feature = "tracing")]
22#[macro_export]
23macro_rules! info {
24    ($($arg:tt)*) => {{
25        tracing::info!($($arg)*);
26    }};
27}
28
29#[cfg(not(feature = "tracing"))]
30#[macro_export]
31macro_rules! error {
32    ($($arg:tt)*) => {{
33        eprintln!($($arg)*);
34    }};
35}
36
37#[cfg(not(feature = "tracing"))]
38#[macro_export]
39macro_rules! warn {
40    ($($arg:tt)*) => {{
41        eprintln!($($arg)*);
42    }};
43}
44
45#[cfg(not(feature = "tracing"))]
46#[macro_export]
47macro_rules! info {
48    ($($arg:tt)*) => {{
49        println!($($arg)*);
50    }};
51}