Skip to content

Commit

Permalink
docs: use brackets for hyphenated properties (#1005)
Browse files Browse the repository at this point in the history
  • Loading branch information
meichstedt authored Apr 9, 2021
1 parent 9f77837 commit 84fa44b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/redaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
> Redaction is not supported in the browser [#670](https://github.com/pinojs/pino/issues/670)
To redact sensitive information, supply paths to keys that hold sensitive data
using the `redact` option:
using the `redact` option. Note that paths which contain hypens need to use
brackets in order to access the hyphenated property:

```js
const logger = require('.')({
redact: ['key', 'path.to.key', 'stuff.thats[*].secret']
redact: ['key', 'path.to.key', 'stuff.thats[*].secret', 'path["with-hyphen"]']
})

logger.info({
Expand Down

0 comments on commit 84fa44b

Please sign in to comment.