import pino from 'pino'; // JSON logger with redaction for auth headers, cookies, and token-like fields. export const log = pino({ level: process.env.LOG_LEVEL ?? (process.env.NODE_ENV === 'production' ? 'info' : 'debug'), redact: { paths: [ 'req.headers["x-substrate-key"]', 'req.headers.authorization', 'req.headers.cookie', 'headers["x-substrate-key"]', 'headers.authorization', 'headers.cookie', '*.apiKey', '*.token', 'apiKey', 'token', ], censor: '[redacted]', }, });