#[cfg(not(feature = "jst"))]
#[macro_export]
macro_rules! info {
($($arg:tt)*) => {
println!("{}{} {} {} {}",
chrono::Utc::now().format("%Y-%m-%dT%H:%M:%S").to_string().bright_black(),
"(UTC)".bright_black(),
" INFO".green(),
format!("{}:", module_path!()).bright_black(),
format_args!($($arg)*)
);
}
}
#[cfg(feature = "jst")]
#[macro_export]
macro_rules! info {
($($arg:tt)*) => {
println!("{}{} {} {} {}",
(chrono::Utc::now() + chrono::Duration::hours(9)).format("%Y-%m-%dT%H:%M:%S").to_string().bright_black(),
"(JST)".bright_black(),
" INFO".green(),
format!("{}:", module_path!()).bright_black(),
format_args!($($arg)*)
);
}
}
#[cfg(not(feature = "jst"))]
#[macro_export]
macro_rules! warn {
($($arg:tt)*) => {
println!("{}{} {} {} {}",
chrono::Utc::now().format("%Y-%m-%dT%H:%M:%S").to_string().bright_black(),
"(UTC)".bright_black(),
" WARN".bright_yellow(),
format!("{}:", module_path!()).bright_black(),
format_args!($($arg)*)
);
}
}
#[cfg(feature = "jst")]
#[macro_export]
macro_rules! warn {
($($arg:tt)*) => {
println!("{}{} {} {} {}",
(chrono::Utc::now() + chrono::Duration::hours(9)).format("%Y-%m-%dT%H:%M:%S").to_string().bright_black(),
"(JST)".bright_black(),
" WARN".bright_yellow(),
format!("{}:", module_path!()).bright_black(),
format_args!($($arg)*)
);
}
}
#[cfg(not(feature = "jst"))]
#[macro_export]
macro_rules! error {
($($arg:tt)*) => {
println!("{}{} {} {} {}",
chrono::Utc::now().format("%Y-%m-%dT%H:%M:%S").to_string().bright_black(),
"(UTC)".bright_black(),
"ERROR".bright_red(),
format!("{}:", module_path!()).bright_black(),
format_args!($($arg)*)
);
}
}
#[cfg(feature = "jst")]
#[macro_export]
macro_rules! error {
($($arg:tt)*) => {
println!("{}{} {} {} {}",
(chrono::Utc::now() + chrono::Duration::hours(9)).format("%Y-%m-%dT%H:%M:%S").to_string().bright_black(),
"(JST)".bright_black(),
"ERROR".bright_red(),
format!("{}:", module_path!()).bright_black(),
format_args!($($arg)*)
);
}
}
#[cfg(not(feature = "jst"))]
#[macro_export]
macro_rules! debug {
($($arg:tt)*) => {
println!("{}{} {} {} {}",
chrono::Utc::now().format("%Y-%m-%dT%H:%M:%S").to_string().bright_black(),
"(UTC)".bright_black(),
"DEBUG".bright_cyan(),
format!("{}:", module_path!()).bright_black(),
format_args!($($arg)*)
);
}
}
#[cfg(feature = "jst")]
#[macro_export]
macro_rules! debug {
($($arg:tt)*) => {
println!("{}{} {} {} {}",
(chrono::Utc::now() + chrono::Duration::hours(9)).format("%Y-%m-%dT%H:%M:%S").to_string().bright_black(),
"(JST)".bright_black(),
"DEBUG".bright_cyan(),
format!("{}:", module_path!()).bright_black(),
format_args!($($arg)*)
);
}
}
#[cfg(not(feature = "jst"))]
#[macro_export]
macro_rules! trace {
($($arg:tt)*) => {
println!("{}{} {} {} {}",
chrono::Utc::now().format("%Y-%m-%dT%H:%M:%S").to_string().bright_black(),
"(UTC)".bright_black(),
"TRACE".bright_blue(),
format!("{}:", module_path!()).bright_black(),
format_args!($($arg)*)
);
}
}
#[cfg(feature = "jst")]
#[macro_export]
macro_rules! trace {
($($arg:tt)*) => {
println!("{}{} {} {} {}",
(chrono::Utc::now() + chrono::Duration::hours(9)).format("%Y-%m-%dT%H:%M:%S").to_string().bright_black(),
"(JST)".bright_black(),
"TRACE".bright_blue(),
format!("{}:", module_path!()).bright_black(),
format_args!($($arg)*)
);
}
}
#[cfg(not(feature = "jst"))]
#[macro_export]
macro_rules! flag {
() => {
println!("{}{} {} {} {}",
chrono::Utc::now().format("%Y-%m-%dT%H:%M:%S").to_string().bright_black(),
"(UTC)".bright_black(),
" FLAG".bright_magenta(),
format!("{}:", module_path!()).bright_black(),
format_args!("[{}:{}]", file!(), line!())
);
};
($($arg:tt)*) => {
println!("{}{} {} {} {} {}",
chrono::Utc::now().format("%Y-%m-%dT%H:%M:%S").to_string().bright_black(),
"(UTC)".bright_black(),
" FLAG".bright_magenta(),
format!("{}:", module_path!()).bright_black(),
format_args!("[{}:{}]", file!(), line!()),
format_args!($($arg)*)
);
};
}
#[cfg(feature = "jst")]
#[macro_export]
macro_rules! flag {
() => {
println!("{}{} {} {} {}",
(chrono::Utc::now() + chrono::Duration::hours(9)).format("%Y-%m-%dT%H:%M:%S").to_string().bright_black(),
"(JST)".bright_black(),
" FLAG".bright_magenta(),
format!("{}:", module_path!()).bright_black(),
format_args!("[{}:{}]", file!(), line!())
);
};
($($arg:tt)*) => {
println!("{}{} {} {} {} {}",
(chrono::Utc::now() + chrono::Duration::hours(9)).format("%Y-%m-%dT%H:%M:%S").to_string().bright_black(),
"(JST)".bright_black(),
" FLAG".bright_magenta(),
format!("{}:", module_path!()).bright_black(),
format_args!("[{}:{}]", file!(), line!()),
format_args!($($arg)*)
);
};
}
#[cfg(feature = "utc_jst")]
pub mod jst {
#[macro_export]
macro_rules! info_jst {
($($arg:tt)*) => {
println!("{}{} {} {} {}",
(chrono::Utc::now() + chrono::Duration::hours(9)).format("%Y-%m-%dT%H:%M:%S").to_string().bright_black(),
"(JST)".bright_black(),
" INFO".green(),
format!("{}:", module_path!()).bright_black(),
format_args!($($arg)*)
);
}
}
#[macro_export]
macro_rules! warn_jst {
($($arg:tt)*) => {
println!("{}{} {} {} {}",
(chrono::Utc::now() + chrono::Duration::hours(9)).format("%Y-%m-%dT%H:%M:%S").to_string().bright_black(),
"(JST)".bright_black(),
" WARN".bright_yellow(),
format!("{}:", module_path!()).bright_black(),
format_args!($($arg)*)
);
}
}
#[macro_export]
macro_rules! error_jst {
($($arg:tt)*) => {
println!("{}{} {} {} {}",
(chrono::Utc::now() + chrono::Duration::hours(9)).format("%Y-%m-%dT%H:%M:%S").to_string().bright_black(),
"(JST)".bright_black(),
"ERROR".bright_red(),
format!("{}:", module_path!()).bright_black(),
format_args!($($arg)*)
);
}
}
#[macro_export]
macro_rules! debug_jst {
($($arg:tt)*) => {
println!("{}{} {} {} {}",
(chrono::Utc::now() + chrono::Duration::hours(9)).format("%Y-%m-%dT%H:%M:%S").to_string().bright_black(),
"(JST)".bright_black(),
"DEBUG".bright_cyan(),
format!("{}:", module_path!()).bright_black(),
format_args!($($arg)*)
);
}
}
#[macro_export]
macro_rules! trace_jst {
($($arg:tt)*) => {
println!("{}{} {} {} {}",
(chrono::Utc::now() + chrono::Duration::hours(9)).format("%Y-%m-%dT%H:%M:%S").to_string().bright_black(),
"(JST)".bright_black(),
"TRACE".bright_blue(),
format!("{}:", module_path!()).bright_black(),
format_args!($($arg)*)
);
}
}
#[macro_export]
macro_rules! flag_jst {
() => {
println!("{}{} {} {} {}",
(chrono::Utc::now() + chrono::Duration::hours(9)).format("%Y-%m-%dT%H:%M:%S").to_string().bright_black(),
"(JST)".bright_black(),
" FLAG".bright_magenta(),
format!("{}:", module_path!()).bright_black(),
format_args!("[{}:{}]", file!(), line!())
);
};
($($arg:tt)*) => {
println!("{}{} {} {} {} {}",
(chrono::Utc::now() + chrono::Duration::hours(9)).format("%Y-%m-%dT%H:%M:%S").to_string().bright_black(),
"(JST)".bright_black(),
" FLAG".bright_magenta(),
format!("{}:", module_path!()).bright_black(),
format_args!("[{}:{}]", file!(), line!()),
format_args!($($arg)*)
);
};
}
}