import winston from 'winston' ; /**
 * sets up and stores the winston logger
 */ export class LogInstance { param message public static debug ( message ) { LogInstance . logger . debug ( message ) ; } param message public static error ( message ) { LogInstance . logger . error ( message ) ; } param message public static info ( message ) { LogInstance . logger . info ( message ) ; } param message public static warn ( message ) { LogInstance . logger . warn ( message ) ; } /**
     * setup winston logger
     */ public static init ( ) { LogInstance . logger = winston . createLogger ( { format : winston . format . json ( ) , level : 'info' , transports : [ new winston . transports . File ( { filename : 'error.log' , level : 'error' } ) , new winston . transports . File ( { filename : 'combined.log' } ) ] } ) ; if ( process . env . NODE_ENV === 'development' ) { LogInstance . logger . add ( new winston . transports . Console ( { format : winston . format . simple ( ) , level : 'debug' } ) ) ; } } private static logger : winston . Logger ; } LogInstance . init ( ) ;