Skip to content

Commit

Permalink
feat: make it easier to create distinct loggers
Browse files Browse the repository at this point in the history
  • Loading branch information
Codeneos committed Aug 21, 2024
1 parent f1407ba commit a826577
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/core/src/logging/logger.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LogLevel } from '../logging';
import { DistinctLogger, LogLevel } from '../logging';
import { isPromise } from '@vlocode/util';
import LogManager from './logManager';
import { LogEntry, LoggerEntry } from './logEntry';
Expand Down Expand Up @@ -142,4 +142,11 @@ export class Logger {
}
}

/**
* Returns a new logger that wraps the current logger and filters out duplicate log messages.
* @returns A new `DistinctLogger` instance.
*/
public distinct() {
return new DistinctLogger(this);
}
}

0 comments on commit a826577

Please sign in to comment.