tree_decorator/macros/
log.rs1#[macro_export]
22macro_rules! tree_item_debug {
23 ($first_style_name:ident $( : $first_style_value:expr )? $( ; $other_style_name:ident $( : $other_style_value:expr )? )* , $str:literal $($arg:tt)*) => {
24 log::debug!(
25 "{}",
26 $crate::tree_item!($first_style_name $( : $ first_style_value )? $( ; $other_style_name $( : $other_style_value )? )* , $str $( $arg )*)
27 );
28 };
29
30 ($first_style_name:ident $( : $first_style_value:expr )? $( ; $other_style_name:ident $( : $other_style_value:expr )? )*) => {
31 log::debug!(
32 "{}",
33 $crate::tree_item!($first_style_name $( : $first_style_value )? $( ; $other_style_name $( : $other_style_value )? )*)
34 );
35 };
36
37 ($str:literal $($arg:tt)*) => {
38 log::debug!(
39 "{}",
40 $crate::tree_item!($str $( $arg )*)
41 );
42 };
43
44 () => {
45 log::debug!(
46 "{}",
47 $crate::tree_item!()
48 );
49 };
50}
51
52#[macro_export]
73macro_rules! tree_item_error {
74 ($first_style_name:ident $( : $first_style_value:expr )? $( ; $other_style_name:ident $( : $other_style_value:expr )? )* , $str:literal $($arg:tt)*) => {
75 log::error!(
76 "{}",
77 $crate::tree_item!($first_style_name $( : $ first_style_value )? $( ; $other_style_name $( : $other_style_value )? )* , $str $( $arg )*)
78 );
79 };
80
81 ($first_style_name:ident $( : $first_style_value:expr )? $( ; $other_style_name:ident $( : $other_style_value:expr )? )*) => {
82 log::error!(
83 "{}",
84 $crate::tree_item!($first_style_name $( : $first_style_value )? $( ; $other_style_name $( : $other_style_value )? )*)
85 );
86 };
87
88 ($str:literal $($arg:tt)*) => {
89 log::error!(
90 "{}",
91 $crate::tree_item!($str $( $arg )*)
92 );
93 };
94
95 () => {
96 log::error!(
97 "{}",
98 $crate::tree_item!()
99 );
100 };
101}
102
103#[macro_export]
124macro_rules! tree_item_info {
125 ($first_style_name:ident $( : $first_style_value:expr )? $( ; $other_style_name:ident $( : $other_style_value:expr )? )* , $str:literal $($arg:tt)*) => {
126 log::info!(
127 "{}",
128 $crate::tree_item!($first_style_name $( : $ first_style_value )? $( ; $other_style_name $( : $other_style_value )? )* , $str $( $arg )*)
129 );
130 };
131
132 ($first_style_name:ident $( : $first_style_value:expr )? $( ; $other_style_name:ident $( : $other_style_value:expr )? )*) => {
133 log::info!(
134 "{}",
135 $crate::tree_item!($first_style_name $( : $first_style_value )? $( ; $other_style_name $( : $other_style_value )? )*)
136 );
137 };
138
139 ($str:literal $($arg:tt)*) => {
140 log::info!(
141 "{}",
142 $crate::tree_item!($str $( $arg )*)
143 );
144 };
145
146 () => {
147 log::info!(
148 "{}",
149 $crate::tree_item!()
150 );
151 };
152}
153
154#[macro_export]
175macro_rules! tree_item_trace {
176 ($first_style_name:ident $( : $first_style_value:expr )? $( ; $other_style_name:ident $( : $other_style_value:expr )? )* , $str:literal $($arg:tt)*) => {
177 log::trace!(
178 "{}",
179 $crate::tree_item!($first_style_name $( : $ first_style_value )? $( ; $other_style_name $( : $other_style_value )? )* , $str $( $arg )*)
180 );
181 };
182
183 ($first_style_name:ident $( : $first_style_value:expr )? $( ; $other_style_name:ident $( : $other_style_value:expr )? )*) => {
184 log::trace!(
185 "{}",
186 $crate::tree_item!($first_style_name $( : $first_style_value )? $( ; $other_style_name $( : $other_style_value )? )*)
187 );
188 };
189
190 ($str:literal $($arg:tt)*) => {
191 log::trace!(
192 "{}",
193 $crate::tree_item!($str $( $arg )*)
194 );
195 };
196
197 () => {
198 log::info!(
199 "{}",
200 $crate::tree_item!()
201 );
202 };
203}
204
205
206#[macro_export]
227macro_rules! tree_item_warn {
228 ($first_style_name:ident $( : $first_style_value:expr )? $( ; $other_style_name:ident $( : $other_style_value:expr )? )* , $str:literal $($arg:tt)*) => {
229 log::warn!(
230 "{}",
231 $crate::tree_item!($first_style_name $( : $ first_style_value )? $( ; $other_style_name $( : $other_style_value )? )* , $str $( $arg )*)
232 );
233 };
234
235 ($first_style_name:ident $( : $first_style_value:expr )? $( ; $other_style_name:ident $( : $other_style_value:expr )? )*) => {
236 log::warn!(
237 "{}",
238 $crate::tree_item!($first_style_name $( : $first_style_value )? $( ; $other_style_name $( : $other_style_value )? )*)
239 );
240 };
241
242 ($str:literal $($arg:tt)*) => {
243 log::warn!(
244 "{}",
245 $crate::tree_item!($str $( $arg )*)
246 );
247 };
248
249 () => {
250 log::warn!(
251 "{}",
252 $crate::tree_item!()
253 );
254 };
255}