Skip to main content

zune_core/
log.rs

1/*
2 * Copyright (c) 2023.
3 *
4 * This software is free software;
5 *
6 * You can redistribute it or modify it under terms of the MIT, Apache License or Zlib license
7 */
8
9// Re-export macros under nicer names
10pub use crate::{
11    __debug as debug, __error as error, __info as info, __log_enabled as log_enabled,
12    __trace as trace, __warn as warn
13};
14
15#[repr(usize)]
16#[derive(Copy, Clone, Eq, PartialEq, Debug, Hash)]
17pub enum Level {
18    Error = 1,
19    Warn,
20    Info,
21    Debug,
22    Trace
23}
24
25//
26// log_enabled (unchanged)
27//
28#[doc(hidden)]
29#[macro_export]
30macro_rules! __log_enabled {
31    ($lvl:expr) => {{
32        let _ = $lvl;
33        false
34    }};
35}
36
37//
38// ERROR
39//
40#[cfg(feature = "std")]
41#[doc(hidden)]
42#[macro_export]
43macro_rules! __error {
44    ($($arg:tt)+) => {};
45}
46
47#[cfg(not(feature = "std"))]
48#[doc(hidden)]
49#[macro_export]
50macro_rules! __error {
51    ($($arg:tt)+) => {};
52}
53
54//
55// WARN
56//
57#[cfg(feature = "std")]
58#[doc(hidden)]
59#[macro_export]
60macro_rules! __warn {
61    ($($arg:tt)+) => {};
62}
63
64#[cfg(not(feature = "std"))]
65#[doc(hidden)]
66#[macro_export]
67macro_rules! __warn {
68    ($($arg:tt)+) => {};
69}
70
71//
72// INFO
73//
74#[cfg(feature = "std")]
75#[doc(hidden)]
76#[macro_export]
77macro_rules! __info {
78    ($($arg:tt)+) => {};
79}
80
81#[cfg(not(feature = "std"))]
82#[doc(hidden)]
83#[macro_export]
84macro_rules! __info {
85    ($($arg:tt)+) => {};
86}
87
88//
89// DEBUG
90//
91#[cfg(feature = "std")]
92#[doc(hidden)]
93#[macro_export]
94macro_rules! __debug {
95    ($($arg:tt)+) => {};
96}
97
98#[cfg(not(feature = "std"))]
99#[doc(hidden)]
100#[macro_export]
101macro_rules! __debug {
102    ($($arg:tt)+) => {};
103}
104
105//
106// TRACE
107//
108#[cfg(feature = "std")]
109#[doc(hidden)]
110#[macro_export]
111macro_rules! __trace {
112    ($($arg:tt)+) => {};
113}
114
115#[cfg(not(feature = "std"))]
116#[doc(hidden)]
117#[macro_export]
118macro_rules! __trace {
119    ($($arg:tt)+) => {};
120}