File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -306,6 +306,8 @@ logger.fatal(new Error('Unrecoverable error'));
306306added: REPLACEME
307307-->
308308
309+ > Stability: 1.1 - Active Development
310+
309311* ` bindings ` {Object} Additional context fields for the child logger.
310312* ` options ` {Object}
311313 * ` level ` {string} Log level for the child logger.
@@ -383,6 +385,18 @@ added: REPLACEME
383385The ` LogConsumer` class is the base class for log consumers. Consumers
384386subscribe to ` diagnostics_channel` events and process log records.
385387
388+ One channel is published per log level. The channel names are:
389+
390+ * ` log: trace`
391+ * ` log: debug`
392+ * ` log: info`
393+ * ` log: warn`
394+ * ` log: error`
395+ * ` log: fatal`
396+
397+ Advanced users may subscribe to these channels directly via
398+ ` diagnostics_channel .channel (name)` instead of using a ` LogConsumer` .
399+
386400### ` new LogConsumer ([options])`
387401
388402<!-- YAML
@@ -560,6 +574,11 @@ JSON-serializable will cause an error at log time:
560574* Functions are silently omitted by `JSON.stringify()`.
561575* Circular references throw a `TypeError`.
562576
577+ `Error` objects are an exception: the built-in `err` serializer runs by
578+ default and converts them to plain objects (with `type`, `message`, `stack`,
579+ and a recursively serialized `cause`) before they reach `JSON.stringify()`,
580+ so logging errors directly does not trigger the issues above.
581+
563582To log `BigInt` values, convert them to strings or numbers first:
564583
565584```js
You can’t perform that action at this time.
0 commit comments