mirror of
https://github.com/lisk77/comet.git
synced 2025-10-23 21:38:50 +00:00
initial commit
This commit is contained in:
commit
6154c72b0e
55 changed files with 9481 additions and 0 deletions
8
crates/comet_log/Cargo.toml
Normal file
8
crates/comet_log/Cargo.toml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
[package]
|
||||
name = "comet_log"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
chrono = "0.4"
|
||||
colored = "2.0"
|
||||
47
crates/comet_log/src/lib.rs
Normal file
47
crates/comet_log/src/lib.rs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
#[macro_export]
|
||||
macro_rules! info {
|
||||
($msg:expr) => {
|
||||
println!(
|
||||
"{} {} : {}",
|
||||
chrono::Local::now().format("%Y-%m-%d %H:%M:%S"),
|
||||
"\x1b[32m\x1b[1mINFO\x1b[0m",
|
||||
$msg
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! debug {
|
||||
($msg:expr) => {
|
||||
println!(
|
||||
"{} {} : {}",
|
||||
chrono::Local::now().format("%Y-%m-%d %H:%M:%S"),
|
||||
"\x1b[34m\x1b[1mDEBUG\x1b[0m",
|
||||
$msg
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! warn {
|
||||
($msg:expr) => {
|
||||
println!(
|
||||
"{} {} : {}",
|
||||
chrono::Local::now().format("%Y-%m-%d %H:%M:%S"),
|
||||
"\x1b[33m\x1b[1mWARNING\x1b[0m",
|
||||
$msg
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! error {
|
||||
($msg:expr) => {
|
||||
println!(
|
||||
"{} {} : {}",
|
||||
chrono::Local::now().format("%Y-%m-%d %H:%M:%S"),
|
||||
"\x1b[31m\x1b[1mERROR\x1b[0m",
|
||||
$msg
|
||||
);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue