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
#[macro_export(local_inner_macros)]
macro_rules! notify_informational {
    // trace!("a {} event", "log")
    ($typ:expr, $($arg:tt)+) => (notify!($crate::notifications::Priority::Informational, $typ, $($arg)+))
}

#[macro_export(local_inner_macros)]
macro_rules! notify_info {
    // trace!("a {} event", "log")
    ($typ:expr, $($arg:tt)+) => (notify!($crate::notifications::Priority::Informational, $typ, $($arg)+))
}

#[macro_export(local_inner_macros)]
macro_rules! notify_low {
    // trace!("a {} event", "log")
    ($typ:expr, $($arg:tt)+) => (notify!($crate::notifications::Priority::Low, $typ, $($arg)+))
}

#[macro_export(local_inner_macros)]
macro_rules! notify_medium {
    // trace!("a {} event", "log")
    ($typ:expr, $($arg:tt)+) => (notify!($crate::notifications::Priority::Medium, $typ, $($arg)+))
}

#[macro_export(local_inner_macros)]
macro_rules! notify_high {
    // trace!("a {} event", "log")
    ($typ:expr, $($arg:tt)+) => (notify!($crate::notifications::Priority::High, $typ, $($arg)+))
}
#[macro_export(local_inner_macros)]
macro_rules! notify_critical {
    // trace!("a {} event", "log")
    ($typ:expr, $($arg:tt)+) => (notify!($crate::notifications::Priority::Critical, $typ, $($arg)+))
}

#[macro_export(local_inner_macros)]
macro_rules! notify {
    // log!( Level::Info; "a {} event", "log");
    ($priority:expr, $typ:expr, $($arg:tt)+) => ({
        let priority = $priority;
        let typ = $typ;
        let _ = $crate::notifications::NOTIFIER.with(|v| {
            let notifier = v.borrow();
            notifier.notify(priority,typ, std::module_path!(), std::file!(), std::line!(), std::borrow::Cow::Owned(std::format!($($arg)+)));
        });
    });
}