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:
parent
88d045aa9c
commit
9326312fca
@ -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
@ -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",
|
||||||
|
@ -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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user