/**
 * Simple service for logging the module.
 */ export abstract class NgxUploadLogger { /** Write a log message. */ abstract log ( ... args ) ; /** Write an information message. */ abstract info ( ... args ) ; /** Write a warning message. */ abstract warn ( ... args ) ; /** Write an error message. */ abstract error ( ... args ) ; /** Write a debug message. */ abstract debug ( ... args ) ; } const noop = ( ) : any => undefined ; /**
 * Default implementation of Logger that safely writes the message into the console.
 *
 */ export class ConsoleLogger implements NgxUploadLogger { constructor ( private _console , private _debugEnabled = true ) { } log ( ... args ) { this . _invokeConsoleMethod ( 'log' , args ) ; } info ( ... args ) { this . _invokeConsoleMethod ( 'info' , args ) ; } warn ( ... args ) { this . _invokeConsoleMethod ( 'warn' , args ) ; } error ( ... args ) { this . _invokeConsoleMethod ( 'error' , args ) ; } debug ( ... args ) { if ( this . _debugEnabled ) { this . _invokeConsoleMethod ( 'debug' , args ) ; } } private _invokeConsoleMethod ( type , args ? ) { let logFn = ( < any > this . _console ) [ type ] || this . _console . log || noop ; if ( ! logFn . apply ) { logFn = Function . prototype . bind . call ( logFn , this . _console ) ; } logFn . apply ( this . _console , args ) ; } } /**
 * No op implementation of Logger.
 *
 */ export class NoOpLogger implements NgxUploadLogger { log ( ) { } info ( ) { } warn ( ) { } error ( ) { } debug ( ) { } }