blob: 2c61f1c80acae59dd858c6b4cb384576513a48f1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
use chrono::prelude::*;
use crossterm::style::{Color, Stylize};
use std::io::{stdout, Write};
#[macro_export]
macro_rules! print_now {
($($arg:tt)*) => {
$crate::utils::print_now(&format!($($arg)*))
};
}
pub fn print_now<T: ToString>(text: T) {
print!("{}", text.to_string());
let _ = stdout().flush();
}
pub fn now() -> String {
let now = Local::now();
now.to_rfc3339_opts(SecondsFormat::Secs, false)
}
pub fn emphasis(text: &str) -> String {
text.stylize().with(Color::White).to_string()
}
|