13
13
* [ logger.fatal()] ( #fatal )
14
14
* [ logger.silent()] ( #silent )
15
15
* [ logger.child()] ( #child )
16
- * [ logger.bindings()] ( #bindings )
16
+ * [ logger.bindings()] ( #logger-bindings )
17
+ * [ logger.setBindings()] ( #logger-set-bindings )
17
18
* [ logger.flush()] ( #flush )
18
19
* [ logger.level] ( #logger-level )
19
20
* [ logger.isLevelEnabled()] ( #islevelenabled )
@@ -888,6 +889,7 @@ The log level of a child is mutable. It can be set independently
888
889
of the parent either by setting the [` level` ](#level) accessor after creating
889
890
the child logger or using the [` options .level ` ](#optionslevel-string) key.
890
891
892
+ <a id="logger-child-bindings"></a>
891
893
#### ` bindings` (Object)
892
894
893
895
An object of key-value pairs to include in every log line output
@@ -978,7 +980,7 @@ child.info({test: 'will be overwritten'})
978
980
* See [` serializers` option](#opt-serializers)
979
981
* See [pino.stdSerializers](#pino-stdSerializers)
980
982
981
- <a id="bindings"></a>
983
+ <a id="logger- bindings"></a>
982
984
### ` logger .bindings ()`
983
985
984
986
Returns an object containing all the current bindings, cloned from the ones passed in via ` logger .child ()` .
@@ -991,6 +993,16 @@ console.log(anotherChild.bindings())
991
993
// { foo: 'bar', MIX: { IN: 'always' } }
992
994
` ` `
993
995
996
+ <a id="logger-set-bindings"></a>
997
+ ### ` logger .setBindings (bindings)`
998
+
999
+ Adds to the bindings of this logger instance.
1000
+
1001
+ **Note:** Does not overwrite bindings. Can potentially result in duplicate keys in
1002
+ log lines.
1003
+
1004
+ * See [` bindings` parameter in ` logger .child ` ](#logger-child-bindings)
1005
+
994
1006
<a id="flush"></a>
995
1007
### ` logger .flush ([cb])`
996
1008
0 commit comments