Skip to content

Commit

Permalink
Merge pull request #3 from Akmot9/dev
Browse files Browse the repository at this point in the history
it diplays the logs in the cli
  • Loading branch information
Akmot9 authored Aug 7, 2023
2 parents c48ebb0 + 5f6b4b3 commit f3128ad
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ Cargo.lock

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

*.log
16 changes: 1 addition & 15 deletions file.log
Original file line number Diff line number Diff line change
@@ -1,16 +1,2 @@
[2023-08-06 22:24:36.414999818 UTC] Test message 1

[2023-08-06 22:24:36.415110458 UTC] Test message 2

[2023-08-06 22:24:36.714024987 UTC] This is a log message.

[2023-08-06 22:24:36.714163469 UTC] Another log message with a value: 42

[2023-08-06 22:24:36.741582353 UTC] This is a log message.

[2023-08-06 22:24:36.741726988 UTC] Another log message with a value: 42

[2023-08-06 22:24:36.745424388 UTC] This is a log message.

[2023-08-06 22:24:36.745496464 UTC] Another log message with a value: 42
[2023-08-07 21:55:28.310429743 UTC] error: Something went wrong!

1 change: 1 addition & 0 deletions src/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ macro_rules! log {
let log_message = format!($($arg)*);
let now = Utc::now();
let log_line = format!("[{}] {}\n", now, log_message);
println!("{log_line}");

if let Ok(mut file) = OpenOptions::new()
.append(true)
Expand Down

0 comments on commit f3128ad

Please sign in to comment.