Changing error output a bit.
This commit is contained in:
parent
34817704ca
commit
dfd9356423
2
out/index.d.ts
vendored
2
out/index.d.ts
vendored
@ -16,7 +16,7 @@ export declare class Logging {
|
|||||||
static warning(...message: any[]): void;
|
static warning(...message: any[]): void;
|
||||||
static logWithCustomColors(type: LoggingTypes, colors: string, ...message: any[]): void;
|
static logWithCustomColors(type: LoggingTypes, colors: string, ...message: any[]): void;
|
||||||
static error(error: Error | string): void;
|
static error(error: Error | string): void;
|
||||||
static errorMessage(...message: string[]): void;
|
static errorMessage(...message: any[]): void;
|
||||||
private static message(type, message, customColors?);
|
private static message(type, message, customColors?);
|
||||||
private static writeMessageToFile(message, error?);
|
private static writeMessageToFile(message, error?);
|
||||||
private static checkQueue();
|
private static checkQueue();
|
||||||
|
@ -49,11 +49,11 @@ class Logging {
|
|||||||
static error(error) {
|
static error(error) {
|
||||||
if (typeof error === "string") {
|
if (typeof error === "string") {
|
||||||
let e = new Error();
|
let e = new Error();
|
||||||
Logging.errorMessage(error + e.stack);
|
Logging.message(LoggingTypes.Error, [error, ":", e.stack]);
|
||||||
return;
|
}
|
||||||
|
else {
|
||||||
|
Logging.message(LoggingTypes.Error, [error.name, ":", error.message, ":", error.stack]);
|
||||||
}
|
}
|
||||||
var message = error.name + " " + error.message + "\n" + error.stack;
|
|
||||||
Logging.message(LoggingTypes.Error, [message]);
|
|
||||||
}
|
}
|
||||||
static errorMessage(...message) {
|
static errorMessage(...message) {
|
||||||
Logging.message(LoggingTypes.Error, message);
|
Logging.message(LoggingTypes.Error, message);
|
||||||
|
File diff suppressed because one or more lines are too long
10
src/index.ts
10
src/index.ts
@ -71,15 +71,13 @@ export class Logging {
|
|||||||
static error(error: Error | string) {
|
static error(error: Error | string) {
|
||||||
if (typeof error === "string") {
|
if (typeof error === "string") {
|
||||||
let e = new Error()
|
let e = new Error()
|
||||||
Logging.errorMessage(error + e.stack);
|
Logging.message(LoggingTypes.Error, [error, ":", e.stack]);
|
||||||
return;
|
} else {
|
||||||
|
Logging.message(LoggingTypes.Error, [error.name, ":", error.message, ":", error.stack]);
|
||||||
}
|
}
|
||||||
|
|
||||||
var message = error.name + " " + error.message + "\n" + error.stack;
|
|
||||||
Logging.message(LoggingTypes.Error, [message]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static errorMessage(...message: string[]) {
|
static errorMessage(...message: any[]) {
|
||||||
Logging.message(LoggingTypes.Error, message);
|
Logging.message(LoggingTypes.Error, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user