import { LogEntry } from '../logger.js' ; import { Transform } from '../transform.js' ; /** Configuration options for the Caterpillar Filter Transform */ export interface FilterOptions { /** Use to override the default value of  Filter . filterLevel filterLevel ? : number ; } example export class Filter extends Transform { /**
     * Only display entries that have a log level below or equal to this number.
     * Defaults to `6`, which by default is the info log level.
     */ public filterLevel : number = 6 ; /** Create our instance and apply our configuraiton options. */ constructor ( opts ? ) { super ( ) ; if ( opts ?. filterLevel != null ) this . filterLevel = opts . filterLevel ; } /** Retain only log entries that are equal to or less than the specified filter level. */ format ( entry ) { return entry . levelNumber <= this . filterLevel ? entry : null ; } } export default Filter ;