mirror of
https://git.stamm.me/OpenServer/NodeLogging.git
synced 2024-12-23 04:39:24 +00:00
Adding multi line stack trace in console, not in file
This commit is contained in:
parent
8f4b7c19e0
commit
82cff60b68
@ -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
@ -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",
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user