Skip to content

Commit

Permalink
Fix Error Log in console
Browse files Browse the repository at this point in the history
  • Loading branch information
saiteja-madha committed Mar 19, 2022
1 parent 52e706a commit 8822ba0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/helpers/logger.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { inspect } = require("util");
const { MessageEmbed, WebhookClient } = require("discord.js"),
chalk = require("chalk"),
moment = require("moment"),
Expand Down Expand Up @@ -53,7 +54,9 @@ const sendLogs = (level, content, data) => {
break;

case "error":
console.log(`[${chalk.cyan(timestamp)}] [${chalk.redBright(level)}] ${content} ${data ? ": " + data : ""}`);
console.log(
`[${chalk.cyan(timestamp)}] [${chalk.redBright(level)}] ${content} ${data ? ": " + inspect(data) : ""}`
);
simpleLogger.error(data ? data : content);
if (errorWebhook) sendWebhook(content, data);
break;
Expand Down

0 comments on commit 8822ba0

Please sign in to comment.