export enum OutLevel { Log , Info , Warn , Error , None } export class Logger { private outLevel = OutLevel . Warn ; public setOutLevel ( level ) { this . outLevel = level ; } error ( message ? , ... optionalParams ) { if ( this . outLevel <= OutLevel . Error ) { console . error ( message , ... optionalParams ) ; } } info ( message ? , ... optionalParams ) { if ( this . outLevel <= OutLevel . Info ) { console . info ( message , ... optionalParams ) ; } } log ( message ? , ... optionalParams ) { if ( this . outLevel <= OutLevel . Log ) { console . log ( message , ... optionalParams ) ; } } warn ( message ? , ... optionalParams ) { if ( this . outLevel <= OutLevel . Warn ) { console . warn ( message , ... optionalParams ) ; } } } const logger = new Logger ( ) ; export default logger ;