Skip to content

Commit

Permalink
fix: always return a LogReturn instead of null
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng committed Aug 21, 2024
1 parent 20bfbab commit b46b77d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ export class Logs {
private _maxLevel = -1;
static console: PrettyLogs;

private _log({ level, consoleLog, logMessage, metadata, type }: LogParams): LogReturn | null {
private _log({ level, consoleLog, logMessage, metadata, type }: LogParams): LogReturn {
// filter out more verbose logs according to maxLevel set in config
if (this._getNumericLevel(level) > this._maxLevel) return null;
if (this._getNumericLevel(level) < this._maxLevel) {
consoleLog(logMessage, metadata);
}

consoleLog(logMessage, metadata);
return new LogReturn(
{
raw: logMessage,
Expand Down

0 comments on commit b46b77d

Please sign in to comment.