Skip to content

Commit

Permalink
update Logger.js
Browse files Browse the repository at this point in the history
  • Loading branch information
fdciabdul committed Jun 11, 2024
1 parent f3d41e1 commit 0b3e07a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/src/Logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ class Logger {
constructor() {}

log(path, user, link, status, error = null) {
const exist = fs.existsSync(path);

if (!exist) {
fs.writeFileSync(path, "");
}
const date = new Date().toLocaleTimeString();
const err = error ? " | Error: " + error : "";
const log = `[${date}] | User: ${user} | Link: ${link} | Status: ${status}${err}`;
Expand Down

0 comments on commit 0b3e07a

Please sign in to comment.