pino streamWrite hook: masks secrets in a finished log line.
Every line passes here on its way to a destination, so this covers what
pino's own options cannot. `redact.paths` are exact, case-sensitive names
with no any-depth wildcard, and `formatters.bindings` runs once, before any
child logger exists. So field names, fields at any depth, lists, child
bindings and a logged `Error` are all masked here, by the text masker's key
rule. pino writes a key twice when a child binding and a call's field share
it; `JSON.parse` keeps the last. A line that cannot be walked is masked as
text by the same keys, so logging never throws: pino writes an own
`constructor` field's value unquoted, and a line nested deep enough
overflows the walk. See `streamWrite` and `bindings` in
https://github.com/pinojs/pino/blob/v10.3.1/docs/api.md
Parameters
line: string
One serialised log line, with its line ending.
Returns string
The line with every secret masked, and the same line ending.
pino
streamWritehook: masks secrets in a finished log line.Every line passes here on its way to a destination, so this covers what pino's own options cannot. `redact.paths` are exact, case-sensitive names with no any-depth wildcard, and `formatters.bindings` runs once, before any child logger exists. So field names, fields at any depth, lists, child bindings and a logged `Error` are all masked here, by the text masker's key rule. pino writes a key twice when a child binding and a call's field share it; `JSON.parse` keeps the last. A line that cannot be walked is masked as text by the same keys, so logging never throws: pino writes an own `constructor` field's value unquoted, and a line nested deep enough overflows the walk. See `streamWrite` and `bindings` in https://github.com/pinojs/pino/blob/v10.3.1/docs/api.md