mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-05-01 09:59:59 -07:00
global: datasets compression via zstd
This commit is contained in:
@@ -1,8 +1,17 @@
|
||||
use std::{fs::OpenOptions, io::Write};
|
||||
use std::{
|
||||
fs::{self, OpenOptions},
|
||||
io::Write,
|
||||
};
|
||||
|
||||
use chrono::Local;
|
||||
use color_eyre::owo_colors::OwoColorize;
|
||||
|
||||
const LOG_PATH: &str = "./.log";
|
||||
|
||||
pub fn reset_logs() {
|
||||
let _ = fs::remove_file(LOG_PATH);
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub fn log(str: &str) {
|
||||
let date_time = format!("{}", Local::now().format("%Y-%m-%d %H:%M:%S -"));
|
||||
@@ -13,7 +22,7 @@ pub fn log(str: &str) {
|
||||
let mut file = OpenOptions::new()
|
||||
.create(true)
|
||||
.append(true)
|
||||
.open("./parser.log")
|
||||
.open(LOG_PATH)
|
||||
.unwrap();
|
||||
|
||||
if let Err(e) = writeln!(file, "{} {}", date_time, line) {
|
||||
|
||||
Reference in New Issue
Block a user