import winston from "winston";
import 'winston-daily-rotate-file';

export default class SingleLevelRotateTransport extends winston.transports.DailyRotateFile{
    /**
     * 
     * @param {import("winston-daily-rotate-file").DailyRotateFileTransportOptions} options 
     */
    constructor(options = null){
        super(options)
    }

    log(info, callback){
        if(info.level.toLowerCase() == this.level.toLowerCase()){
            super.log(info, callback);
        } else {
            callback(null, false);
        }
    }
}