export class SimpleLogger { private loggerID = Math . random ( ) . toString ( 32 ) . slice ( 2 , 6 ) ; constructor ( private prefix , private debug ) { } private getLogString ( ) { return `🌟 react-admin-import-csv:: ${ this . prefix } [${ this . loggerID }] ` ; } public get log ( ) { if ( ! this . debug ) { return ( ... any ) => { } ; } const boundLogFn = console . log . bind ( console , this . getLogString ( ) ) ; return boundLogFn ; } public get warn ( ) { if ( ! this . debug ) { return ( ... any ) => { } ; } const boundLogFn = console . warn . bind ( console , this . getLogString ( ) ) ; return boundLogFn ; } public get error ( ) { if ( ! this . debug ) { return ( ... any ) => { } ; } const boundLogFn = console . error . bind ( console , this . getLogString ( ) ) ; return boundLogFn ; } setEnabled ( logging ) { this . debug = logging ; } }