Skip to content

Commit

Permalink
fix(logHandler): stringify objects instead of trying to split it
Browse files Browse the repository at this point in the history
  • Loading branch information
jrainville committed Dec 20, 2018
1 parent 1a4b0aa commit 33d6e29
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/lib/utils/logHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,13 @@ class LogHandler {
processedMessages = [msg.message];
} else if (Array.isArray(msg.message)) {
msg.message.forEach(message => {
if (Array.isArray(message)) message = message.join('\n');
let lines = message.split("\n");
lines.forEach(line => processedMessages.push(line));
if (Array.isArray(message)) {
return message.forEach(line => processedMessages.push(line));
}
if (typeof message === 'object') {
return processedMessages.push(JSON.stringify(msg.message));
}
message.toString().split("\n").forEach(line => processedMessages.push(line));
});
} else if (typeof msg.message === 'object') {
processedMessages.push(JSON.stringify(msg.message));
Expand Down

0 comments on commit 33d6e29

Please sign in to comment.