import * as debugPackage from "debug" ; const _debug = debugPackage ( "node-tradfri-client" ) ; export type LoggerFunction = ( message : string , severity ? : "info" | "warn" | "debug" | "error" | "silly" ) => void ; let customLogger ; export function setCustomLogger ( logger ) { customLogger = logger ; } export function log ( message , severity = "info" ) { function defaultLogger ( ) { let prefix = "" ; if ( severity !== "info" ) { prefix = `[${ severity . toUpperCase ( ) }] ` ; } _debug ( `${ prefix }${ message }` ) ; } ( customLogger || defaultLogger ) ( message , severity ) ; }