Skip to content

Commit

Permalink
docs: bindings formatter function usage (#1702)
Browse files Browse the repository at this point in the history
  • Loading branch information
nadhifikbarw authored May 2, 2023
1 parent 941f908 commit 513e10f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,8 @@ const formatters = {
##### `bindings`

Changes the shape of the bindings. The default shape is `{ pid, hostname }`.
The function takes a single argument, the bindings object. It will
be called every time a child logger is created.
The function takes a single argument, the bindings object, which can be configured
using the [`base` option](#opt-base). Called once when creating logger.

```js
const formatters = {
Expand Down Expand Up @@ -402,6 +402,7 @@ child.info('User authenticated!')
// > [HTTP] User authenticated!
```

<a id=opt-base></a>
#### `base` (Object)

Default: `{pid: process.pid, hostname: os.hostname}`
Expand Down

0 comments on commit 513e10f

Please sign in to comment.