mirror of
https://git.stamm.me/OpenServer/NodeLogging.git
synced 2024-11-14 17:11:04 +00:00
Optimizing error log output
This commit is contained in:
parent
88d045aa9c
commit
9326312fca
@ -96,10 +96,10 @@ class LoggingBase {
|
||||
error(error) {
|
||||
if (typeof error === "string") {
|
||||
let e = new Error();
|
||||
this.message(LoggingTypes.Error, [error, ":", e.stack]);
|
||||
this.message(LoggingTypes.Error, [error, "\n", e.stack]);
|
||||
}
|
||||
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) {
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hibas123/nodelogging",
|
||||
"version": "1.3.6",
|
||||
"version": "1.3.7",
|
||||
"description": "",
|
||||
"main": "out/index.js",
|
||||
"types": "out/index.d.ts",
|
||||
|
@ -127,9 +127,9 @@ export class LoggingBase {
|
||||
error(error: Error | string) {
|
||||
if (typeof error === "string") {
|
||||
let e = new Error()
|
||||
this.message(LoggingTypes.Error, [error, ":", e.stack]);
|
||||
this.message(LoggingTypes.Error, [error, "\n", e.stack]);
|
||||
} 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));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user