Skip to content

Commit

Permalink
fix(logger): Update log level to use FUSION_LOG_LEVEL environment var…
Browse files Browse the repository at this point in the history
…iable (#2463)
  • Loading branch information
odinr committed Sep 16, 2024
1 parent 15152e4 commit 1d0033e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/modules/module/src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ export interface IConsoleLogger {
warn(...msg: unknown[]): void;
error(...msg: unknown[]): void;
}

/**
* @todo replace with proper logger
*/
export class ConsoleLogger implements IConsoleLogger {
/** - 0-1-2-3 (error-warning-info-debug) if not provided only errors are logged */
public level: 0 | 1 | 2 | 3 | 4 = process.env.NODE_ENV === 'development' ? 3 : 1;
public level: 0 | 1 | 2 | 3 | 4 =
(Number(process.env.FUSION_LOG_LEVEL) as 0 | 1 | 2 | 3 | 4) || 1;
constructor(protected domain: string) {}

/** @inheritdoc */
Expand Down

0 comments on commit 1d0033e

Please sign in to comment.