Skip to content

Commit

Permalink
fix client.error (SudhanPlayz#885) (SudhanPlayz#886)
Browse files Browse the repository at this point in the history
* fix `client.error` (SudhanPlayz#885)
  • Loading branch information
brianferri authored Jun 12, 2022
1 parent 94359c2 commit 2f57ee5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/DiscordMusicBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ class DiscordMusicBot extends Client {
warn(text) {
//this.logger.warn(text);
}

/**
* Send an error message
* @param {string} text
*/
error(text) {
this.logger.error(text);
}

/**
* Build em
Expand Down
13 changes: 13 additions & 0 deletions lib/Logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@ class Logger {
) + colors.yellow(" | " + Text)
);
}

error(Text) {
let d = new Date();
this.logger.log({
level: "error",
message: "error: " + Text,
});
console.log(
colors.gray(
`[${d.getDate()}:${d.getMonth()}:${d.getFullYear()} - ${d.getHours()}:${d.getMinutes()}]`
) + colors.red(" | " + Text)
);
}
}

module.exports = Logger;

0 comments on commit 2f57ee5

Please sign in to comment.