1
0
mirror of https://git.stamm.me/OpenServer/NodeLogging.git synced 2024-11-14 23:11:04 +00:00

Adding multi line stack trace in console, not in file

This commit is contained in:
Fabian Stamm 2017-10-21 14:40:54 +02:00
parent 8f4b7c19e0
commit 82cff60b68
4 changed files with 6 additions and 6 deletions

View File

@ -51,7 +51,7 @@ class Logging {
}
let m = "";
error.stack.forEach(e => {
m += e.toString() + " | ";
m += e.toString() + "\n";
});
var message = error.name + " " + error.message + "\n" + m;
Logging.message(LoggingTypes.Error, [message]);
@ -108,7 +108,7 @@ class Logging {
console.log(consoleLogFormat + m + Reset);
}
static writeMessageToFile(message, error) {
Logging.queue.push({ message: message.replace("\n", ""), error: error });
Logging.queue.push({ message: message.replace("\n", " "), error: error });
Logging.checkQueue();
}
static checkQueue() {

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "logger-perfcloud",
"version": "1.0.6",
"version": "1.0.8",
"description": "",
"main": "out/index.js",
"types": "out/index.d.ts",

View File

@ -69,7 +69,7 @@ export class Logging {
}
let m = "";
(<any>error.stack).forEach(e => {
m += e.toString() + " | ";
m += e.toString() + "\n";
})
var message = error.name + " " + error.message + "\n" + m;
Logging.message(LoggingTypes.Error, [message]);
@ -125,7 +125,7 @@ export class Logging {
}
private static writeMessageToFile(message: string, error?: boolean) {
Logging.queue.push({ message: message.replace("\n", ""), error: error });
Logging.queue.push({ message: message.replace("\n", " "), error: error });
Logging.checkQueue();
}