Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Appended current time into internal logs #342

Merged
merged 1 commit into from
Mar 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/ThundraLogger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ class ThundraLogger {
*/
static debug(message: any, ...optionalParams: any[]) {
if (ThundraLogger.isDebugEnabled()) {
this.consoleDebug.apply(console, ['[THUNDRA]', message, ...optionalParams]);
this.consoleDebug.apply(
console,
['[THUNDRA]', 'DEBUG', '-', new Date().toUTCString(), '|', message, ...optionalParams]);
}
}

Expand All @@ -45,7 +47,9 @@ class ThundraLogger {
* @param optionalParams the optional parameters to be logged
*/
static info(message: any, ...optionalParams: any[]) {
this.consoleInfo.apply(console, ['[THUNDRA]', message, ...optionalParams]);
this.consoleInfo.apply(
console,
['[THUNDRA]', 'INFO', '-', new Date().toUTCString(), '|', message, ...optionalParams]);
}

/**
Expand All @@ -54,7 +58,9 @@ class ThundraLogger {
* @param optionalParams the optional parameters to be logged
*/
static error(error: any, ...optionalParams: any[]) {
this.consoleError.apply(console, ['[THUNDRA]', error, ...optionalParams]);
this.consoleError.apply(
console,
['[THUNDRA]', 'ERROR', '-', new Date().toUTCString(), '|', error, ...optionalParams]);
}

private static getConsoleMethod(methodName: string): Function {
Expand Down