const logger = console ; type LogLevel = keyof typeof logger ; const redact = ( args ) : string [ ] => args . map ( arg => JSON . stringify ( arg instanceof Error ? arg . toString ( ) : arg , ( k , v ) => [ 'lat' , 'lng' ] . includes ( k ) ? '[REDACTED]' : v ) ) ; const log = ( level , ... args ) : string [ ] => { const redacted = process . env . QUIET === 'true' ? [ ] : redact ( args ) ; if ( redacted . length ) { logger [ level ] ( level . toUpperCase ( ) , ... redacted ) ; } return redacted ; } ; const info = ( ... args ) => log ( 'info' , ... args ) ; const warn = ( ... args ) => log ( 'warn' , ... args ) ; const error = ( ... args ) => log ( 'error' , ... args ) ; export default { log , info , warn , error } ;