/**
 * Logging interface.
 */ export interface Logger { error ( message , err ? ) : void ; warn ( message , err ? ) : void ; } /**
 * Logger that logs to console.out
 */ export const consoleLogger = { error ( message , error ) { console . error ( 'ERROR: ' + message , error ? error : '' ) ; } , warn ( message , error ) { console . warn ( 'WARN: ' + message , error ? error : '' ) ; } , } ; let provider = consoleLogger ; export const Log = { error ( message , error ) { provider . error ( message , error ) ; } , warn ( message , error ) { provider . warn ( message , error ) ; } , } ; param logger returns export function setLogger ( logger ) { const previous = provider ; provider = logger ; return previous ; }