1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-22 14:53:17 +00:00

fixed error logging of objects

This commit is contained in:
MatteZ02 2020-06-29 20:48:42 +03:00
parent 60e40029cd
commit 83b56b73a0
2 changed files with 8 additions and 4 deletions

View File

@ -28,11 +28,13 @@ const oldConsole = {};
oldConsole.log = console.log;
console.log = function (arg) {
oldConsole.log(arg);
if (!config.devMode && arg) webhookClient.send(arg);
if (!config.devMode && arg)
webhookClient.send(JSON.stringify(arg));
};
oldConsole.error = console.error;
console.error = function (arg) {
oldConsole.error(arg);
if (!client.devMode && arg) webhookClient.send(arg);
if (!config.devMode && arg)
webhookClient.send(JSON.stringify(arg));
};

View File

@ -7,11 +7,13 @@ const oldConsole = {};
oldConsole.log = console.log;
console.log = function (arg) {
oldConsole.log(arg);
if (!client.config.devMode && arg) webhookClient.send(arg);
if (!client.config.devMode && arg)
webhookClient.send(JSON.stringify(arg));
};
oldConsole.error = console.error;
console.error = function (arg) {
oldConsole.error(arg);
if (!client.config.devMode && arg) webhookClient.send(arg);
if (!client.config.devMode && arg)
webhookClient.send(JSON.stringify(arg));
};