mirror of
https://git.stamm.me/OpenServer/NodeLogging.git
synced 2024-11-22 17:19:23 +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 = "";
|
let m = "";
|
||||||
error.stack.forEach(e => {
|
error.stack.forEach(e => {
|
||||||
m += e.toString() + " | ";
|
m += e.toString() + "\n";
|
||||||
});
|
});
|
||||||
var message = error.name + " " + error.message + "\n" + m;
|
var message = error.name + " " + error.message + "\n" + m;
|
||||||
Logging.message(LoggingTypes.Error, [message]);
|
Logging.message(LoggingTypes.Error, [message]);
|
||||||
@ -108,7 +108,7 @@ class Logging {
|
|||||||
console.log(consoleLogFormat + m + Reset);
|
console.log(consoleLogFormat + m + Reset);
|
||||||
}
|
}
|
||||||
static writeMessageToFile(message, error) {
|
static writeMessageToFile(message, error) {
|
||||||
Logging.queue.push({ message: message.replace("\n", ""), error: error });
|
Logging.queue.push({ message: message.replace("\n", " "), error: error });
|
||||||
Logging.checkQueue();
|
Logging.checkQueue();
|
||||||
}
|
}
|
||||||
static checkQueue() {
|
static checkQueue() {
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "logger-perfcloud",
|
"name": "logger-perfcloud",
|
||||||
"version": "1.0.6",
|
"version": "1.0.8",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "out/index.js",
|
"main": "out/index.js",
|
||||||
"types": "out/index.d.ts",
|
"types": "out/index.d.ts",
|
||||||
|
@ -69,7 +69,7 @@ export class Logging {
|
|||||||
}
|
}
|
||||||
let m = "";
|
let m = "";
|
||||||
(<any>error.stack).forEach(e => {
|
(<any>error.stack).forEach(e => {
|
||||||
m += e.toString() + " | ";
|
m += e.toString() + "\n";
|
||||||
})
|
})
|
||||||
var message = error.name + " " + error.message + "\n" + m;
|
var message = error.name + " " + error.message + "\n" + m;
|
||||||
Logging.message(LoggingTypes.Error, [message]);
|
Logging.message(LoggingTypes.Error, [message]);
|
||||||
@ -125,7 +125,7 @@ export class Logging {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static writeMessageToFile(message: string, error?: boolean) {
|
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();
|
Logging.checkQueue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user