aboutsummaryrefslogtreecommitdiff
path: root/src/macros.rs
blob: 8b4d3af4245cba9eb24ae17036462eb55157e926 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#![macro_use]

#[macro_export]
macro_rules! check_error {
    ($e:expr) => {
        if let Err(err) = $e {
            warn!("ERROR [{}:{}] {:?}", line!(), column!(), err);
        }
    };
}

macro_rules! failed {
    ($e:expr) => { warn!("[{}:{}] {}", line!(), column!(), $e); };
    ($e:expr, $w:expr) => { warn!("[{}:{}] {} | {}", line!(), column!(), $e, $w); };
}

macro_rules! now {
    () => { Utc::now().format("%FT%T").to_string() };
}