#2244·pino

browser: logger does not pass arguments to write function

Author: MorrizCreated Jul 25, 2025Updated Aug 11, 2026

when logging this way:

typescript
const log = logger('context')

log.debug('bla', { di: 'da' })

the arguments do not end up anywhere in the write function:

typescript
...
     browser: {
      write: (logObj, ...logParams) => {
        const { level, msg, time } = logObj as Record<string, string>
        const timeFormatted = new Date(time).toISOString()
        const levelColor = levelColors[level as keyof typeof levelColors]
        console.log(`[${timeFormatted}] ${levelColor}${level} ${color.cyan} ${msg} ${color.white}`, ...logParams)
      },
      formatters: {
        level: label => {
          return {
            level: label,
          }
        },
      },
    },
...

arguments always has length 1. Neither logObj contains them, and logParams is always undefined.