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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
//! Module for all the Macros
/// macro for logging with a specific [`Level`]
///
/// # Example
///
/// ```
/// use aul::level::Level;
/// use aul::log;
///
/// log!(Level::INFO,"This is an information");
/// // [INFO]: This is an information
/// let num = 1;
/// log!(Level::DEBUG,"{} + {}","This is a debugging message",num);
/// // [DEBUG]: This is a debugging message + 1
/// ```
///
/// [`Level`]: crate::Level
/// macro for logging sensitive data with a specific [`Level`]
///
/// # Example
///
/// ```
/// use aul::level::Level;
/// use aul::{log, log_sensitive};
///
/// log_sensitive!(Level::INFO,"This is a sensitive information");
/// // [INFO]: This is an information
/// // change env variable "SAFE_LOGGING" to true
/// log_sensitive!(Level::INFO,"This is a sensitive information");
/// // [INFO]: [REDACTED]
/// log_sensitive!(Level::INFO,"{} - {}","Info 1","Info 2");
/// // [INFO]: [REDACTED]
/// ```
///
/// [`Level`]: crate::Level
/// macro for logging with Level [`INFO`]
///
/// # Example
///
/// ```
/// use aul::info;
/// use aul::log;
/// use aul::level::Level;
/// info!("This is an information");
/// // [INFO]: This is an information
/// ```
///
/// [`INFO`]: crate::Level::INFO
/// macro for logging with Level [`ERROR`]
///
/// # Example
///
/// ```
/// use aul::error;
/// use aul::log;
/// use aul::level::Level;
/// error!("This is an error");
/// // [ERROR]: This is an error
/// ```
///
/// [`ERROR`]: crate::Level::ERROR
/// macro for logging with Level [`TRACE`]
///
/// # Example
///
/// ```
/// use aul::trace;
/// use aul::log;
/// use aul::level::Level;
/// trace!("calling method add");
/// // [TRACE]: calling method add
/// ```
///
/// [`TRACE`]: crate::Level::TRACE
/// macro for logging with Level [`DEBUG`]
///
/// # Example
///
/// ```
/// use aul::debug;
/// use aul::log;
/// use aul::level::Level;
/// debug!("debugging info");
/// // [DEBUG]: debugging info
/// ```
///
/// [`DEBUG`]: crate::Level::DEBUG
/// macro for logging with Level [`WARN`]
///
/// # Example
///
/// ```
/// use aul::{log, warn};
/// use aul::level::Level;
/// warn!("WARNING");
/// log!(Level::INFO,"hello")
/// // [WARN]: WARNING
/// ```
///
/// [`WARN`]: crate::Level::WARN