import { Logger as WinstonLogger } from 'winston' ; import { LoggerConfigInterface } from '../Config' ; import winston from 'winston' ; export class LoggerService { private readonly adapter : WinstonLogger ; constructor ( config ) { this . adapter = winston . createLogger ( config ) ; } public getAdapter ( ) { return this . adapter ; } log ( level , message ? , ... logArguments ) { this . adapter . log ( level as string , message , ... logArguments ) ; return this ; } error ( message , ... logArguments ) { return this . log ( 'error' , message , ... logArguments ) ; } warn ( message , ... logArguments ) { return this . log ( 'warn' , message , ... logArguments ) ; } help ( message , ... logArguments ) { return this . log ( 'help' , message , ... logArguments ) ; } data ( message , ... logArguments ) { return this . log ( 'data' , message , ... logArguments ) ; } info ( message , ... logArguments ) { return this . log ( 'info' , message , ... logArguments ) ; } debug ( message , ... logArguments ) { return this . log ( 'debug' , message , ... logArguments ) ; } prompt ( message , ... logArguments ) { return this . log ( 'prompt' , message , ... logArguments ) ; } http ( message , ... logArguments ) { return this . log ( 'http' , message , ... logArguments ) ; } verbose ( message , ... logArguments ) { return this . log ( 'verbose' , message , ... logArguments ) ; } input ( message , ... logArguments ) { return this . log ( 'input' , message , ... logArguments ) ; } silly ( message , ... logArguments ) { return this . log ( 'silly' , message , ... logArguments ) ; } emerg ( message , ... logArguments ) { return this . log ( 'emerg' , message , ... logArguments ) ; } alert ( message , ... logArguments ) { return this . log ( 'alert' , message , ... logArguments ) ; } crit ( message , ... logArguments ) { return this . log ( 'crit' , message , ... logArguments ) ; } warning ( message , ... logArguments ) { return this . log ( 'warning' , message , ... logArguments ) ; } notice ( message , ... logArguments ) { return this . log ( 'notice' , message , ... logArguments ) ; } }