1
0
mirror of https://git.stamm.me/OpenServer/NodeLogging.git synced 2024-11-22 11:59:24 +00:00

Optimizing error log output

This commit is contained in:
Fabian Stamm 2018-09-02 12:22:39 +02:00
parent 88d045aa9c
commit 9326312fca
4 changed files with 6 additions and 6 deletions

View File

@ -96,10 +96,10 @@ class LoggingBase {
error(error) { error(error) {
if (typeof error === "string") { if (typeof error === "string") {
let e = new Error(); let e = new Error();
this.message(LoggingTypes.Error, [error, ":", e.stack]); this.message(LoggingTypes.Error, [error, "\n", e.stack]);
} }
else { else {
this.message(LoggingTypes.Error, [error.name, ":", error.message, ":", error.stack], undefined, getCallerFromExisting(error)); this.message(LoggingTypes.Error, [error.message, "\n", error.stack], undefined, getCallerFromExisting(error));
} }
} }
errorMessage(...message) { errorMessage(...message) {

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"name": "@hibas123/nodelogging", "name": "@hibas123/nodelogging",
"version": "1.3.6", "version": "1.3.7",
"description": "", "description": "",
"main": "out/index.js", "main": "out/index.js",
"types": "out/index.d.ts", "types": "out/index.d.ts",

View File

@ -127,9 +127,9 @@ export class LoggingBase {
error(error: Error | string) { error(error: Error | string) {
if (typeof error === "string") { if (typeof error === "string") {
let e = new Error() let e = new Error()
this.message(LoggingTypes.Error, [error, ":", e.stack]); this.message(LoggingTypes.Error, [error, "\n", e.stack]);
} else { } else {
this.message(LoggingTypes.Error, [error.name, ":", error.message, ":", error.stack], undefined, getCallerFromExisting(error)); this.message(LoggingTypes.Error, [error.message, "\n", error.stack], undefined, getCallerFromExisting(error));
} }
} }