You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nestedChild5.info('I do log because of filter Bar');
216
219
```
217
220
221
+
The minimum level a child logger is "enabled" to is ENV `LOG_FILTER_ENABLE_LEVEL` or `trace`, by default. It can also be specified by passing `labelEnableLevel` to childLogger options.
222
+
223
+
The minimum level a child logger is "disabled" to is ENV `LOG_FILTER_DISABLE_LEVEL` or `silent`, by default. It can also be specified by passing `labelDisableLevel` to childLogger options.
224
+
225
+
There are also options for passing your own function to determine if a child logger should be enabled or disabled. See [`childLogger`](https://foxxmd.github.io/logging/functions/index.childLogger.html) docs for full a full reference.
226
+
227
+
A caveat to be aware of: **enable/disable by filter is evaluated once, when `childLogger` is instantiated.** This means:
228
+
229
+
* Only the labels added by `childLogger` insantiation are applicable. Labels added during logging, IE `logger.info({labels: ['Runtime']}, "a log")`, are not considered.
230
+
* Labels that are functions are evaluated **once**, when `childLogger` is instantiated
231
+
* Changing the `LOG_FILTER_*` envs after a childLogger is created will have no effect on it
232
+
218
233
### Serializing Objects and Errors
219
234
220
235
Passing an object or array as the first argument to the logger will cause the object to be JSONified and pretty printed below the log message
0 commit comments