From 23498bb9e0df860d35219a10ef5402f7649a56b3 Mon Sep 17 00:00:00 2001 From: nadhifikbarw Date: Tue, 2 May 2023 22:30:08 +0700 Subject: [PATCH] docs: bindings formatter function usage --- docs/api.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/api.md b/docs/api.md index e410c2a26..2e1ec1c9c 100644 --- a/docs/api.md +++ b/docs/api.md @@ -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 = { @@ -402,6 +402,7 @@ child.info('User authenticated!') // > [HTTP] User authenticated! ``` + #### `base` (Object) Default: `{pid: process.pid, hostname: os.hostname}`