type LoggerMethodName = "log" | "info" | "warn" | "error" ; export type Logger = { readonly [ K in LoggerMethodName ] : ( ... xs : any [ ] ) => void ; } ; let prefix = "" ; let logger = console ; export function setPrefix ( p ) { prefix = p ; } export function setLogger ( l ) { logger = l ; } export function log ( str ) { logger . log ( prefix , str ) ; } export function info ( str ) { logger . info ( prefix , str ) ; } export function warning ( str ) { logger . warn ( prefix , str ) ; } export function error ( str ) { logger . error ( prefix , str ) ; }