import chalk from "chalk" ; class Logger { public debugEnabled : boolean = false ; public showWarnings : boolean = true ; public warn ( ... args ) { if ( this . showWarnings ) { args . unshift ( "Warning:" ) ; args = args . map ( ( str ) => chalk . yellow ( str ) ) ; console . warn . apply ( console , args as any ) ; } } public debug ( ... args ) { if ( this . debugEnabled ) { args . unshift ( chalk . gray ( "debug" ) ) ; console . log . apply ( console , args as any ) ; } } } export const logger = new Logger ( ) ;