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
#[macro_export]
macro_rules! crit( ($($args:tt)+) => {
::slog_global::crit!($($args)+)
};);
#[macro_export]
macro_rules! error {
(?$e:expr; $l:literal) => {
::slog_global::error!($l; "err" => ?$e,"err_code" => %error_code::ErrorCodeExt::error_code(&$e))
};
(%$e:expr; $l:literal) => {
::slog_global::error!($l; "err" => ?$e,"err_code" => %error_code::ErrorCodeExt::error_code(&$e))
};
(?$e:expr; $($args:tt)+) => {
::slog_global::error!($($args)+ "err" => ?$e,"err_code" => %error_code::ErrorCodeExt::error_code(&$e))
};
(%$e:expr; $($args:tt)+) => {
::slog_global::error!($($args)+ "err" => %$e,"err_code" => %error_code::ErrorCodeExt::error_code(&$e))
};
($($args:tt)+) => {
::slog_global::error!($($args)+)
};
}
#[macro_export]
macro_rules! error_unknown {
(?$e:expr; $l:literal) => {
::slog_global::error!($l; "err" => ?$e,"err_code" => %error_code::UNKNOWN)
};
(%$e:expr; $l:literal) => {
::slog_global::error!($l; "err" => ?$e,"err_code" => %error_code::UNKNOWN)
};
(?$e:expr; $($args:tt)+) => {
::slog_global::error!($($args)+ "err" => ?$e,"err_code" => %error_code::UNKNOWN)
};
(%$e:expr; $($args:tt)+) => {
::slog_global::error!($($args)+ "err" => %$e,"err_code" => %error_code::UNKNOWN)
};
}
#[macro_export]
macro_rules! warn(($($args:tt)+) => {
::slog_global::warn!($($args)+)
};);
#[macro_export]
macro_rules! info(($($args:tt)+) => {
::slog_global::info!($($args)+)
};);
#[macro_export]
macro_rules! debug(($($args:tt)+) => {
::slog_global::debug!($($args)+)
};);
#[macro_export]
macro_rules! trace(($($args:tt)+) => {
::slog_global::trace!($($args)+)
};);