[READ-ONLY] Mirror of https://github.com/FoxxMD/logging. A typed, opinionated, batteries-included, Pino-based logging solution for backend TS/JS projects foxxmd.github.io/logging
child-logger logging logging-library nodejs pinojs typescript-library
0

Configure Feed

Select the types of activity you want to include in your feed.

fix: Guard against undefined message key when redacting

FoxxMD (Dec 10, 2025, 8:18 PM EST) 6ed3602a 559e4a1d

+1 -1
+1 -1
src/pretty.ts
··· 40 40 messageFormat: (log, messageKey, levelLabel, {colors}) => { 41 41 const labels: string[] = log.labels as string[] ?? []; 42 42 const labelContent = labels.length === 0 ? '' : `${labels.map((x: string) => colors.blackBright(`[${x}]`)).join(' ')} `; 43 - const msg = redactFunc((log[messageKey] as string)); 43 + const msg = redactFunc((log[messageKey] as string) ?? ''); 44 44 let stackTrace = log.err !== undefined ? redactFunc(`\n${(log.err as any).stack}`) : ''; 45 45 stackTrace = stackTrace.replaceAll(/^\s+at\s.+$/gm, (match) => `${colors.blackBright(match)}`) //$& 46 46 return `${labelContent}${msg}${stackTrace}`;