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
This is the first time we've seen this `log.info` style with an object as the first argument. Bunyan logging methods (`log.trace`, `log.debug`, ...) all support an optional **first object argument with extra log record fields**:
206
206
207
207
```javascript
208
-
log.info(<object>fields, <string>msg, ...)
208
+
log.info(/*object*/fields, /*string*/msg/*...*/);
209
209
```
210
210
211
211
Here we pass in the restify Request object, `req`. The "req" serializer we registered above will come into play here, but bear with me.
@@ -250,8 +250,9 @@ Here is the server log:
250
250
251
251
Lets look at each in turn to see what is interesting -- pretty-printed with `node server.js | ./node_modules/.bin/bunyan -j`:
252
252
253
-
```javascript
254
-
{ // (1)
253
+
```json
254
+
{
255
+
// (1)
255
256
"name": "helloapi",
256
257
"hostname": "banana.local",
257
258
"pid": 40442,
@@ -277,8 +278,9 @@ Here we logged the incoming request with `request.log.info({req: request}, 'star
277
278
278
279
Next the `req.log.debug` in our handler:
279
280
280
-
```javascript
281
-
{ // (2)
281
+
```json
282
+
{
283
+
// (2)
282
284
"name": "helloapi",
283
285
"hostname": "banana.local",
284
286
"pid": 40442,
@@ -293,8 +295,9 @@ Next the `req.log.debug` in our handler:
Copy file name to clipboardExpand all lines: apps/site/pages/en/blog/release/v16.14.0.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ This release adds experimental support for the import assertions stage 3 proposa
15
15
To keep Node.js ESM implementation as compatible as possible with the HTML spec, import assertions are now required to import JSON modules (still behind the `--experimental-json-modules` CLI flag):
0 commit comments