1#[allow(dead_code)]
11pub const UUID: &str = "3ec2df31-b5fb-49a9-b91f-de63ec69a058";
12
13#[allow(dead_code)]
15pub const VERSION: &str = "0.4.1";
16
17#[allow(dead_code)]
19pub const RELEASE_DATE: (u16, u8, u8) = (2019, 6, 2);
20
21macro_rules! __ { ($($arg: tt)+) => {
23 format!("[{}][{}-{}] {}", crate::TAG, module_path!(), line!(), format!($($arg)+))
24};}
25
26macro_rules! __b { ($($arg: tt)+) => {
28 format!("\x1b[1m{}\x1b[m", format!($($arg)+))
29};}
30
31macro_rules! __w { ($($arg: tt)+) => {
33 format!("\x1b[38;5;1m{}\x1b[39m", format!($($arg)+))
34};}
35
36macro_rules! __p { ($($arg: tt)+) => {
38 println!("{}", __!($($arg)+));
39};}
40
41#[cfg(unix)]
43macro_rules! __is_char_device { ($fd: expr) => {{
44 use ::std::os::unix::fs::FileTypeExt;
45 use ::std::os::unix::io::RawFd;
46 use ::std::path::PathBuf;
47
48 let fd: RawFd = $fd;
49 match PathBuf::from(format!("/proc/{}/fd/{}", std::process::id(), fd)).metadata().map(|m| m.file_type()) {
50 Ok(ft) => ft.is_char_device(),
51 Err(_) => false,
52 }
53}};}
54
55macro_rules! __pp { ($($arg: tt)+) => {
57 match match cfg!(unix) {
58 true => {
59 use ::std::os::unix::io::AsRawFd;
60 __is_char_device!(::std::io::stdout().as_raw_fd())
61 },
62 false => true,
63 } {
64 true => __p!("{}", __b!("{}", __!($($arg)+))),
65 false => __p!($($arg)+),
66 };
67};}
68
69macro_rules! __e { ($($arg: tt)+) => {
71 eprintln!("{}", __!($($arg)+));
72};}
73
74macro_rules! __ee { ($($arg: tt)+) => {
76 match match cfg!(unix) {
77 true => {
78 use ::std::os::unix::io::AsRawFd;
79 __is_char_device!(::std::io::stderr().as_raw_fd())
80 },
81 false => true,
82 } {
83 true => __e!("{}", __w!("{}", __!($($arg)+))),
84 false => __e!($($arg)+),
85 };
86};}