aboutsummaryrefslogtreecommitdiff
path: root/src/helper
diff options
context:
space:
mode:
Diffstat (limited to 'src/helper')
-rw-r--r--src/helper/init.rs14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/helper/init.rs b/src/helper/init.rs
index 084caf5..abee146 100644
--- a/src/helper/init.rs
+++ b/src/helper/init.rs
@@ -1,18 +1,14 @@
+use chrono::prelude::*;
use std::fs::OpenOptions;
use std::io::{self, Write};
-pub fn print_in_file(content: String) -> io::Result<()> {
- // Open the file (create it if it doesn't exist, or truncate it if it does)
+pub fn warn(content: String) {
let mut file = OpenOptions::new()
.write(true)
.append(true)
.create(true)
- .open("debug.txt")
+ .open("log.txt")
.unwrap();
-
- if let Err(e) = writeln!(file, "{}", content) {
- eprintln!("Couldn't write to file: {}", e);
- }
-
- Ok(())
+ let utc: DateTime<Local> = Local::now();
+ writeln!(file, "[{}] {}", utc, content);
}
ArKa projects. All rights to me, and your next child right arm.