Skip to content

Commit 73678ff

Browse files
authoredSep 16, 2022
docs: grammar and spelling fixes (#1560)
* docs: grammar and spelling fixes * docs: more fixes
1 parent a769539 commit 73678ff

12 files changed

+103
-103
lines changed
 

‎README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ format logs during development:
7272
### Transports & Log Processing
7373

7474
Due to Node's single-threaded event-loop, it's highly recommended that sending,
75-
alert triggering, reformatting and all forms of log processing
76-
be conducted in a separate process or thread.
75+
alert triggering, reformatting, and all forms of log processing
76+
are conducted in a separate process or thread.
7777

78-
In Pino terminology we call all log processors "transports", and recommend that the
78+
In Pino terminology, we call all log processors "transports" and recommend that the
7979
transports be run in a worker thread using our `pino.transport` API.
8080

8181
For more details see our [Transports⇗](docs/transports.md) document.
@@ -92,9 +92,9 @@ See the [Benchmarks](docs/benchmarks.md) document for comparisons.
9292

9393
### Bundling support
9494

95-
Pino supports to being bundled using tools like webpack or esbuild.
95+
Pino supports being bundled using tools like webpack or esbuild.
9696

97-
See [Bundling](docs/bundling.md) document for more informations.
97+
See [Bundling](docs/bundling.md) document for more information.
9898

9999
<a name="team"></a>
100100
## The Team
@@ -139,8 +139,8 @@ Pino is an **OPEN Open Source Project**. This means that:
139139
140140
See the [CONTRIBUTING.md](https://github.com/pinojs/pino/blob/master/CONTRIBUTING.md) file for more details.
141141

142-
<a name="acknowledgements"></a>
143-
## Acknowledgements
142+
<a name="acknowledgments"></a>
143+
## Acknowledgments
144144

145145
This project was kindly sponsored by [nearForm](https://nearform.com).
146146

‎docs/api.md

+22-22
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
## `pino([options], [destination]) => logger`
4141

4242
The exported `pino` function takes two optional arguments,
43-
[`options`](#options) and [`destination`](#destination) and
43+
[`options`](#options) and [`destination`](#destination), and
4444
returns a [logger instance](#logger).
4545

4646
<a id=options></a>
@@ -70,7 +70,7 @@ Additional levels can be added to the instance via the `customLevels` option.
7070
Default: `undefined`
7171

7272
Use this option to define additional logging levels.
73-
The keys of the object correspond the namespace of the log level,
73+
The keys of the object correspond to the namespace of the log level,
7474
and the values should be the numerical value of the level.
7575

7676
```js
@@ -88,7 +88,7 @@ logger.foo('hi')
8888
Default: `false`
8989

9090
Use this option to only use defined `customLevels` and omit Pino's levels.
91-
Logger's default `level` must be changed to a value in `customLevels` in order to use `useOnlyCustomLevels`
91+
Logger's default `level` must be changed to a value in `customLevels` to use `useOnlyCustomLevels`
9292
Warning: this option may not be supported by downstream transports.
9393

9494
```js
@@ -100,13 +100,13 @@ const logger = pino({
100100
level: 'foo'
101101
})
102102
logger.foo('hi')
103-
logger.info('hello') // Will throw an error saying info in not found in logger object
103+
logger.info('hello') // Will throw an error saying info is not found in logger object
104104
```
105105
#### `depthLimit` (Number)
106106

107107
Default: `5`
108108

109-
Option to limit stringification at a specific nesting depth when logging circular object.
109+
Option to limit stringification at a specific nesting depth when logging circular objects.
110110

111111
#### `edgeLimit` (Number)
112112

@@ -266,11 +266,11 @@ Default: `undefined`
266266
As an array, the `redact` option specifies paths that should
267267
have their values redacted from any log output.
268268

269-
Each path must be a string using a syntax which corresponds to JavaScript dot and bracket notation.
269+
Each path must be a string using a syntax that corresponds to JavaScript dot and bracket notation.
270270

271271
If an object is supplied, three options can be specified:
272272
* `paths` (array): Required. An array of paths. See [redaction - Path Syntax ⇗](/docs/redaction.md#paths) for specifics.
273-
* `censor` (String|Function|Undefined): Optional. When supplied as a String the `censor` option will overwrite keys which are to be redacted. When set to `undefined` the key will be removed entirely from the object.
273+
* `censor` (String|Function|Undefined): Optional. When supplied as a String the `censor` option will overwrite keys that are to be redacted. When set to `undefined` the key will be removed entirely from the object.
274274
The `censor` option may also be a mapping function. The (synchronous) mapping function has the signature `(value, path) => redactedValue` and is called with the unredacted `value` and `path` to the key being redacted, as an array. For example given a redaction path of `a.b.c` the `path` argument would be `['a', 'b', 'c']`. The value returned from the mapping function becomes the applied censor value. Default: `'[Redacted]'`
275275
value synchronously.
276276
Default: `'[Redacted]'`
@@ -356,7 +356,7 @@ const formatters = {
356356

357357
Changes the shape of the log object. This function will be called every time
358358
one of the log methods (such as `.info`) is called. All arguments passed to the
359-
log method, except the message, will be pass to this function. By default it does
359+
log method, except the message, will be passed to this function. By default, it does
360360
not change the shape of the log object.
361361

362362
```js
@@ -503,7 +503,7 @@ pino({ transport: {}}, '/path/to/somewhere') // THIS WILL NOT WORK, DO NOT DO TH
503503
pino({ transport: {}}, process.stderr) // THIS WILL NOT WORK, DO NOT DO THIS
504504
```
505505
506-
when using the `transport` option. In this case an `Error` will be thrown.
506+
when using the `transport` option. In this case, an `Error` will be thrown.
507507
508508
* See [pino.transport()](#pino-transport)
509509
@@ -513,7 +513,7 @@ The `onChild` function is a synchronous callback that will be called on each cre
513513
Any error thrown inside the callback will be uncaught and should be handled inside the callback.
514514
```js
515515
const parent = require('pino')({ onChild: (instance) => {
516-
// Exceute call back code for each newly created child.
516+
// Execute call back code for each newly created child.
517517
}})
518518
// `onChild` will now be executed with the new child.
519519
parent.child(bindings)
@@ -567,7 +567,7 @@ path, e.g. `/tmp/1`.
567567
Default: `false`
568568
569569
Using the global symbol `Symbol.for('pino.metadata')` as a key on the `destination` parameter and
570-
setting the key it to `true`, indicates that the following properties should be
570+
setting the key to `true`, indicates that the following properties should be
571571
set on the `destination` object after each log line is written:
572572
573573
* the last logging level as `destination.lastLevel`
@@ -613,7 +613,7 @@ The parameters are explained below using the `logger.info` method but the same a
613613
#### `mergingObject` (Object)
614614
615615
An object can optionally be supplied as the first parameter. Each enumerable key and value
616-
of the `mergingObject` is copied in to the JSON log line.
616+
of the `mergingObject` is copied into the JSON log line.
617617
618618
```js
619619
logger.info({MIX: {IN: true}})
@@ -658,7 +658,7 @@ the following placeholders:
658658
659659
* `%s` – string placeholder
660660
* `%d` – digit placeholder
661-
* `%O`, `%o` and `%j` – object placeholder
661+
* `%O`, `%o`, and `%j` – object placeholder
662662
663663
Values supplied as additional arguments to the logger method will
664664
then be interpolated accordingly.
@@ -776,7 +776,7 @@ Write a `'error'` level log, if the configured `level` allows for it.
776776
777777
Write a `'fatal'` level log, if the configured `level` allows for it.
778778
779-
Since `'fatal'` level messages are intended to be logged just prior to the process exiting the `fatal`
779+
Since `'fatal'` level messages are intended to be logged just before the process exiting the `fatal`
780780
method will always sync flush the destination.
781781
Therefore it's important not to misuse `fatal` since
782782
it will cause performance overhead if used for any
@@ -832,7 +832,7 @@ Options for child logger. These options will override the parent logger options.
832832
##### `options.level` (String)
833833
834834
The `level` property overrides the log level of the child logger.
835-
By default the parent log level is inherited.
835+
By default, the parent log level is inherited.
836836
After the creation of the child logger, it is also accessible using the [`logger.level`](#logger-level) key.
837837
838838
```js
@@ -921,9 +921,9 @@ The core levels and their values are as follows:
921921
922922
The logging level is a *minimum* level based on the associated value of that level.
923923
924-
For instance if `logger.level` is `info` *(30)* then `info` *(30)*, `warn` *(40)*, `error` *(50)* and `fatal` *(60)* log methods will be enabled but the `trace` *(10)* and `debug` *(20)* methods, being less than 30, will not.
924+
For instance if `logger.level` is `info` *(30)* then `info` *(30)*, `warn` *(40)*, `error` *(50)*, and `fatal` *(60)* log methods will be enabled but the `trace` *(10)* and `debug` *(20)* methods, being less than 30, will not.
925925
926-
The `silent` logging level is a specialized level which will disable all logging,
926+
The `silent` logging level is a specialized level that will disable all logging,
927927
the `silent` log method is a noop function.
928928
929929
<a id="islevelenabled"></a>
@@ -994,7 +994,7 @@ $ node -p "require('pino')().levels"
994994
### logger\[Symbol.for('pino.serializers')\]
995995
996996
Returns the serializers as applied to the current logger instance. If a child logger did not
997-
register it's own serializer upon instantiation the serializers of the parent will be returned.
997+
register its own serializer upon instantiation the serializers of the parent will be returned.
998998
999999
<a id="level-change"></a>
10001000
### Event: 'level-change'
@@ -1079,7 +1079,7 @@ A `pino.destination` instance can also be used to reopen closed files
10791079
<a id="pino-transport"></a>
10801080
### `pino.transport(options) => ThreadStream`
10811081
1082-
Create a a stream that routes logs to a worker thread that
1082+
Create a stream that routes logs to a worker thread that
10831083
wraps around a [Pino Transport](/docs/transports.md).
10841084
10851085
```js
@@ -1122,7 +1122,7 @@ const transport = pino.transport({
11221122
pino(transport)
11231123
```
11241124
1125-
If `WeakRef`, `WeakMap` and `FinalizationRegistry` are available in the current runtime (v14.5.0+), then the thread
1125+
If `WeakRef`, `WeakMap`, and `FinalizationRegistry` are available in the current runtime (v14.5.0+), then the thread
11261126
will be automatically terminated in case the stream or logger goes out of scope.
11271127
The `transport()` function adds a listener to `process.on('beforeExit')` and `process.on('exit')` to ensure the worker
11281128
is flushed and all data synced before the process exits.
@@ -1242,7 +1242,7 @@ The `pino.stdSerializers` object provides functions for serializing objects comm
12421242
<a id="pino-stdtimefunctions"></a>
12431243
### `pino.stdTimeFunctions` (Object)
12441244
1245-
The [`timestamp`](#opt-timestamp) option can accept a function which determines the
1245+
The [`timestamp`](#opt-timestamp) option can accept a function that determines the
12461246
`timestamp` value in a log line.
12471247
12481248
The `pino.stdTimeFunctions` object provides a very small set of common functions for generating the
@@ -1258,7 +1258,7 @@ The `pino.stdTimeFunctions` object provides a very small set of common functions
12581258
<a id="pino-symbols"></a>
12591259
### `pino.symbols` (Object)
12601260
1261-
For integration purposes with ecosystem and third party libraries `pino.symbols`
1261+
For integration purposes with ecosystem and third-party libraries `pino.symbols`
12621262
exposes the symbols used to hold non-public state and methods on the logger instance.
12631263
12641264
Access to the symbols allows logger state to be adjusted, and methods to be overridden or

‎docs/asynchronous.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Asynchronous Logging
22

3-
In essence, asynchronous logging enables the minimum overhead of Pino.
3+
Asynchronous logging enables the minimum overhead of Pino.
44
Asynchronous logging works by buffering log messages and writing them in larger chunks.
55

66
```js
@@ -13,16 +13,16 @@ const logger = pino(pino.destination({
1313
```
1414

1515
It's always possible to turn on synchronous logging by passing `sync: true`.
16-
In this mode of operation log messages are directly written to the
17-
output stream, as the messages are generated with a _blocking_ operation.
16+
In this mode of operation, log messages are directly written to the
17+
output stream as the messages are generated with a _blocking_ operation.
1818

1919
* See [`pino.destination`](/docs/api.md#pino-destination)
2020
* `pino.destination` is implemented on [`sonic-boom`](https://github.com/mcollina/sonic-boom).
2121

2222
### AWS Lambda
2323

24-
Asynchronous logging is disabled by default on AWS Lambda, or any other environment
25-
that modifies `process.stdout`. If forcefully turned on, we recommend to call `dest.flushSync()` at the end
24+
Asynchronous logging is disabled by default on AWS Lambda or any other environment
25+
that modifies `process.stdout`. If forcefully turned on, we recommend calling `dest.flushSync()` at the end
2626
of each function execution to avoid losing data.
2727

2828
## Caveats
@@ -36,5 +36,5 @@ Asynchronous logging has a couple of important caveats:
3636

3737
See also:
3838

39-
* [`pino.destination` api](/docs/api.md#pino-destination)
39+
* [`pino.destination` API](/docs/api.md#pino-destination)
4040
* [`destination` parameter](/docs/api.md#destination)

‎docs/browser.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Browser API
22

3-
Pino is compatible with [`browserify`](https://npm.im/browserify) for browser side usage:
3+
Pino is compatible with [`browserify`](https://npm.im/browserify) for browser-side usage:
44

55
This can be useful with isomorphic/universal JavaScript code.
66

@@ -101,7 +101,7 @@ pino.info({custom: 'a', another: 'b'})
101101
```
102102

103103
When `serialize` is `true` the standard error serializer is also enabled (see https://github.com/pinojs/pino/blob/master/docs/api.md#stdSerializers).
104-
This is a global serializer which will apply to any `Error` objects passed to the logger methods.
104+
This is a global serializer, which will apply to any `Error` objects passed to the logger methods.
105105

106106
If `serialize` is an array the standard error serializer is also automatically enabled, it can
107107
be explicitly disabled by including a string in the serialize array: `!stdSerializers.err`, like so:
@@ -141,7 +141,7 @@ message and a `logEvent` object.
141141

142142
The `logEvent` object is a data structure representing a log message, it represents
143143
the arguments passed to a logger statement, the level
144-
at which they were logged and the hierarchy of child bindings.
144+
at which they were logged, and the hierarchy of child bindings.
145145

146146
The `logEvent` format is structured like so:
147147

@@ -154,25 +154,25 @@ The `logEvent` format is structured like so:
154154
}
155155
```
156156

157-
The `ts` property is a unix epoch timestamp in milliseconds, the time is taken from the moment the
157+
The `ts` property is a Unix epoch timestamp in milliseconds, the time is taken from the moment the
158158
logger method is called.
159159

160160
The `messages` array is all arguments passed to logger method, (for instance `logger.info('a', 'b', 'c')`
161161
would result in `messages` array `['a', 'b', 'c']`).
162162

163163
The `bindings` array represents each child logger (if any), and the relevant bindings.
164-
For instance given `logger.child({a: 1}).child({b: 2}).info({c: 3})`, the bindings array
164+
For instance, given `logger.child({a: 1}).child({b: 2}).info({c: 3})`, the bindings array
165165
would hold `[{a: 1}, {b: 2}]` and the `messages` array would be `[{c: 3}]`. The `bindings`
166166
are ordered according to their position in the child logger hierarchy, with the lowest index
167167
being the top of the hierarchy.
168168

169-
By default serializers are not applied to log output in the browser, but they will *always* be
169+
By default, serializers are not applied to log output in the browser, but they will *always* be
170170
applied to `messages` and `bindings` in the `logEvent` object. This allows us to ensure a consistent
171171
format for all values between server and client.
172172

173173
The `level` holds the label (for instance `info`), and the corresponding numerical value
174-
(for instance `30`). This could be important in cases where client side level values and
175-
labels differ from server side.
174+
(for instance `30`). This could be important in cases where client-side level values and
175+
labels differ from server-side.
176176

177177
The point of the `send` function is to remotely record log messages:
178178

@@ -184,7 +184,7 @@ const pino = require('pino')({
184184
send: function (level, logEvent) {
185185
if (level === 'warn') {
186186
// maybe send the logEvent to a separate endpoint
187-
// or maybe analyse the messages further before sending
187+
// or maybe analyze the messages further before sending
188188
}
189189
// we could also use the `logEvent.level.value` property to determine
190190
// numerical value
@@ -205,4 +205,4 @@ const pino = require('pino')({browser: {disabled: true}})
205205
```
206206

207207
The `disabled` option will disable logging in browser if set
208-
to `true`. Default is set to `false`.
208+
to `true`, by default it is set to `false`.

‎docs/bundling.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
Due to its internal architecture based on Worker Threads, it is not possible to bundle Pino *without* generating additional files.
44

5-
In particular, a bundler must ensure that the following files are also bundle separately:
5+
In particular, a bundler must ensure that the following files are also bundled separately:
66

77
* `lib/worker.js` from the `thread-stream` dependency
88
* `file.js`
99
* `lib/worker.js`
1010
* `lib/worker-pipeline.js`
1111
* Any transport used by the user (like `pino-pretty`)
1212

13-
Once the files above have been generated, the bundler must also add information about the files above by injecting a code which sets `__bundlerPathsOverrides` in the `globalThis` object.
13+
Once the files above have been generated, the bundler must also add information about the files above by injecting a code that sets `__bundlerPathsOverrides` in the `globalThis` object.
1414

15-
The variable is a object whose keys are identifier for the files and the values are the paths of files relative to the currently bundle files.
15+
The variable is an object whose keys are an identifier for the files and the values are the paths of files relative to the currently bundle files.
1616

1717
Example:
1818

@@ -27,7 +27,7 @@ globalThis.__bundlerPathsOverrides = {
2727
};
2828
```
2929

30-
Note that `pino/file`, `pino-worker`, `pino-pipeline-worker` and `thread-stream-worker` are required identifiers. Other identifiers are possible based on the user configuration.
30+
Note that `pino/file`, `pino-worker`, `pino-pipeline-worker`, and `thread-stream-worker` are required identifiers. Other identifiers are possible based on the user configuration.
3131

3232
## Webpack Plugin
3333

‎docs/child-loggers.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ benchPinoExtremeChildChild*10000: 127.753ms
5050

5151
## Duplicate keys caveat
5252

53-
It's possible for naming conflicts to arise between child loggers and
53+
Naming conflicts can arise between child loggers and
5454
children of child loggers.
5555

5656
This isn't as bad as it sounds, even if the same keys between
@@ -71,10 +71,10 @@ $ cat my-log
7171
{"pid":95469,"hostname":"MacBook-Pro-3.home","level":30,"msg":"howdy","time":1459534114473,"a":"property","a":"prop"}
7272
```
7373

74-
Notice how there's two key's named `a` in the JSON output. The sub-childs properties
74+
Notice how there are two keys named `a` in the JSON output. The sub-childs properties
7575
appear after the parent child properties.
7676

77-
At some point the logs will most likely be processed (for instance with a [transport](transports.md)),
77+
At some point, the logs will most likely be processed (for instance with a [transport](transports.md)),
7878
and this generally involves parsing. `JSON.parse` will return an object where the conflicting
7979
namespace holds the final value assigned to it:
8080

@@ -92,4 +92,4 @@ in light of an expected log processing approach.
9292

9393
One of Pino's performance tricks is to avoid building objects and stringifying
9494
them, so we're building strings instead. This is why duplicate keys between
95-
parents and children will end up in log output.
95+
parents and children will end up in the log output.

‎docs/ecosystem.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ in a MongoDB database.
4343
+ [`pino-noir`](https://github.com/pinojs/pino-noir): redact sensitive information
4444
in logs.
4545
+ [`pino-pretty`](https://github.com/pinojs/pino-pretty): basic prettifier to
46-
make log lines human readable.
46+
make log lines human-readable.
4747
+ [`pino-socket`](https://github.com/pinojs/pino-socket): send logs to TCP or UDP
4848
destinations.
4949
+ [`pino-std-serializers`](https://github.com/pinojs/pino-std-serializers): the
@@ -64,7 +64,7 @@ the logger for the [Rill framework](https://rill.site/).
6464

6565
+ [`pino-colada`](https://github.com/lrlna/pino-colada): cute ndjson formatter for pino.
6666
+ [`pino-fluentd`](https://github.com/davidedantonio/pino-fluentd): send Pino logs to Elasticsearch,
67-
MongoDB and many [others](https://www.fluentd.org/dataoutputs) via Fluentd.
67+
MongoDB, and many [others](https://www.fluentd.org/dataoutputs) via Fluentd.
6868
+ [`pino-pretty-min`](https://github.com/unjello/pino-pretty-min): a minimal
6969
prettifier inspired by the [logrus](https://github.com/sirupsen/logrus) logger.
7070
+ [`pino-rotating-file`](https://github.com/homeaway/pino-rotating-file): a hapi-pino log transport for splitting logs into separate, automatically rotating files.
@@ -73,4 +73,4 @@ prettifier inspired by the [logrus](https://github.com/sirupsen/logrus) logger.
7373
+ [`pino-dev`](https://github.com/dnjstrom/pino-dev): simple prettifier for pino with built-in support for common ecosystem packages.
7474
+ [`@newrelic/pino-enricher`](https://github.com/newrelic/newrelic-node-log-extensions/blob/main/packages/pino-log-enricher): a log customization to add New Relic context to use [Logs In Context](https://docs.newrelic.com/docs/logs/logs-context/logs-in-context/)
7575
+ [`pino-lambda`](https://github.com/FormidableLabs/pino-lambda): log transport for cloudwatch support inside aws-lambda
76-
+ [`cloud-pine`](https://github.com/metcoder95/cloud-pine): transport that provide abstraction and compatibility with [`@google-cloud/logging`](https://www.npmjs.com/package/@google-cloud/logging).
76+
+ [`cloud-pine`](https://github.com/metcoder95/cloud-pine): transport that provides abstraction and compatibility with [`@google-cloud/logging`](https://www.npmjs.com/package/@google-cloud/logging).

‎docs/help.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ help.
4747
<a id="reopening"></a>
4848
## Reopening log files
4949

50-
In cases where a log rotation tool doesn't offer a copy-truncate capabilities,
50+
In cases where a log rotation tool doesn't offer copy-truncate capabilities,
5151
or where using them is deemed inappropriate, `pino.destination`
52-
is able to reopen file paths after a file has been moved away.
52+
can reopen file paths after a file has been moved away.
5353

5454
One way to use this is to set up a `SIGUSR2` or `SIGHUP` signal handler that
5555
reopens the log file destination, making sure to write the process PID out
@@ -124,7 +124,7 @@ Pino's default log destination is the singular destination of `stdout`. While
124124
not recommended for performance reasons, multiple destinations can be targeted
125125
by using [`pino.multistream`](/doc/api.md#pino-multistream).
126126
127-
In this example we use `stderr` for `error` level logs and `stdout` as default
127+
In this example, we use `stderr` for `error` level logs and `stdout` as default
128128
for all other levels (e.g. `debug`, `info`, and `warn`).
129129
130130
```js
@@ -155,7 +155,7 @@ for information on this is handled.
155155
Pino log lines are meant to be parseable. Thus, Pino's default mode of operation
156156
is to print the level value instead of the string name.
157157
However, you can use the [`formatters`](/docs/api.md#formatters-object) option
158-
with a [`level`](/docs/api.md#level) function to print the string name instead the level value :
158+
with a [`level`](/docs/api.md#level) function to print the string name instead of the level value :
159159

160160
```js
161161
const pino = require('pino')
@@ -175,7 +175,7 @@ log.info('message')
175175
// {"level":"info","time":1661632832200,"pid":18188,"hostname":"foo","msg":"message"}
176176
```
177177

178-
Although it is works, we recommend using one of these options instead if you are able:
178+
Although it works, we recommend using one of these options instead if you are able:
179179

180180
1. If the only change desired is the name then a transport can be used. One such
181181
transport is [`pino-text-level-transport`](https://npm.im/pino-text-level-transport).
@@ -202,7 +202,7 @@ $ npm i pino-debug
202202
$ DEBUG=* node -r pino-debug app.js
203203
```
204204

205-
[`pino-debug`](https://github.com/pinojs/pino-debug) also offers fine grain control to map specific `debug`
205+
[`pino-debug`](https://github.com/pinojs/pino-debug) also offers fine-grain control to map specific `debug`
206206
namespaces to `pino` log levels. See [`pino-debug`](https://github.com/pinojs/pino-debug)
207207
for more.
208208

@@ -211,8 +211,8 @@ for more.
211211

212212
Pino uses [sonic-boom](https://github.com/mcollina/sonic-boom) to speed
213213
up logging. Internally, it uses [`fs.write`](https://nodejs.org/dist/latest-v10.x/docs/api/fs.html#fs_fs_write_fd_string_position_encoding_callback) to write log lines directly to a file
214-
descriptor. On Windows, unicode output is not handled properly in the
215-
terminal (both `cmd.exe` and powershell), and as such the output could
214+
descriptor. On Windows, Unicode output is not handled properly in the
215+
terminal (both `cmd.exe` and PowerShell), and as such the output could
216216
be visualized incorrectly if the log lines include utf8 characters. It
217217
is possible to configure the terminal to visualize those characters
218218
correctly with the use of [`chcp`](https://ss64.com/nt/chcp.html) by
@@ -222,7 +222,7 @@ Node.js.
222222
<a id="stackdriver"></a>
223223
## Mapping Pino Log Levels to Google Cloud Logging (Stackdriver) Severity Levels
224224

225-
Google Cloud Logging uses `severity` levels instead log levels. As a result, all logs may show as INFO
225+
Google Cloud Logging uses `severity` levels instead of log levels. As a result, all logs may show as INFO
226226
level logs while completely ignoring the level set in the pino log. Google Cloud Logging also prefers that
227227
log data is present inside a `message` key instead of the default `msg` key that Pino uses. Use a technique
228228
similar to the one below to retain log levels in Google Cloud Logging

‎docs/pretty.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Pretty Printing
22

33
By default, Pino log lines are newline delimited JSON (NDJSON). This is perfect
4-
for production usage and long term storage. It's not so great for development
4+
for production usage and long-term storage. It's not so great for development
55
environments. Thus, Pino logs can be prettified by using a Pino prettifier
66
module like [`pino-pretty`][pp]:
77

@@ -11,15 +11,15 @@ $ cat app.log | pino-pretty
1111

1212
For almost all situations, this is the recommended way to prettify logs. The
1313
programmatic API, described in the next section, is primarily for integration
14-
purposes with other CLI based prettifiers.
14+
purposes with other CLI-based prettifiers.
1515

1616
## Prettifier API
1717

1818
Pino prettifier modules are extra modules that provide a CLI for parsing NDJSON
19-
log lines piped via `stdin` and expose an API which conforms to the Pino
19+
log lines piped via `stdin` and expose an API that conforms to the Pino
2020
[metadata streams](/docs/api.md#metadata) API.
2121

22-
The API requires modules provide a factory function which returns a prettifier
22+
The API requires modules provide a factory function that returns a prettifier
2323
function. This prettifier function must accept either a string of NDJSON or
2424
a Pino log object. A pseudo-example of such a prettifier is:
2525

@@ -86,7 +86,7 @@ will be written to the destination stream.
8686
that can be passed via `prettyPrint`.
8787

8888
The default prettifier write stream does not guarantee final log writes.
89-
Correspondingly, a warning is written to logs on first synchronous flushing.
89+
Correspondingly, a warning is written to logs on the first synchronous flushing.
9090
This warning may be suppressed by passing `suppressFlushSyncWarning : true` to
9191
`prettyPrint`:
9292
```js

‎docs/redaction.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
> Redaction is not supported in the browser [#670](https://github.com/pinojs/pino/issues/670)
44
55
To redact sensitive information, supply paths to keys that hold sensitive data
6-
using the `redact` option. Note that paths which contain hyphens need to use
7-
brackets in order to access the hyphenated property:
6+
using the `redact` option. Note that paths that contain hyphens need to use
7+
brackets to access the hyphenated property:
88

99
```js
1010
const logger = require('.')({
@@ -120,7 +120,7 @@ Pino's redaction functionality is built on top of [`fast-redact`](https://github
120120
which adds about 2% overhead to `JSON.stringify` when using paths without wildcards.
121121

122122
When used with pino logger with a single redacted path, any overhead is within noise -
123-
a way to deterministically measure it's effect has not been found. This is because its not a bottleneck.
123+
a way to deterministically measure its effect has not been found. This is because it is not a bottleneck.
124124

125125
However, wildcard redaction does carry a non-trivial cost relative to explicitly declaring the keys
126126
(50% in a case where four keys are redacted across two objects). See
@@ -129,7 +129,7 @@ the [`fast-redact` benchmarks](https://github.com/davidmarkclements/fast-redact#
129129
## Safety
130130

131131
The `redact` option is intended as an initialization time configuration option.
132-
It's extremely important that path strings do not originate from user input.
132+
Path strings must not originate from user input.
133133
The `fast-redact` module uses a VM context to syntax check the paths, user input
134134
should never be combined with such an approach. See the [`fast-redact` Caveat](https://github.com/davidmarkclements/fast-redact#caveat)
135135
and the [`fast-redact` Approach](https://github.com/davidmarkclements/fast-redact#approach) for in-depth information.

‎docs/transports.md

+26-26
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ The way Pino generates logs:
1010
It is recommended that any log transformation or transmission is performed either
1111
in a separate thread or a separate process.
1212

13-
Prior to Pino v7 transports would ideally operate in a separate process - these are
13+
Before Pino v7 transports would ideally operate in a separate process - these are
1414
now referred to as [Legacy Transports](#legacy-transports).
1515

16-
From Pino v7 and upwards transports can also operate inside a [Worker Thread][worker-thread],
16+
From Pino v7 and upwards transports can also operate inside a [Worker Thread][worker-thread]
1717
and can be used or configured via the options object passed to `pino` on initialization.
1818

1919
[worker-thread]: https://nodejs.org/dist/latest-v14.x/docs/api/worker_threads.html
2020

2121
## v7+ Transports
2222

23-
A transport is a module that exports a default function which returns a writable stream:
23+
A transport is a module that exports a default function that returns a writable stream:
2424

2525
```js
2626
import { createWriteStream } from 'fs'
@@ -62,11 +62,11 @@ export default async (options) => {
6262
```
6363

6464
While initializing the stream we're able to use `await` to perform asynchronous operations. In this
65-
case waiting for the write streams `open` event.
65+
case, waiting for the write streams `open` event.
6666

6767
Let's imagine the above was published to npm with the module name `some-file-transport`.
6868

69-
The `options.destination` value can be set when the creating the transport stream with `pino.transport` like so:
69+
The `options.destination` value can be set when creating the transport stream with `pino.transport` like so:
7070

7171
```js
7272
const pino = require('pino')
@@ -80,7 +80,7 @@ pino(transport)
8080
Note here we've specified a module by package rather than by relative path. The options object we provide
8181
is serialized and injected into the transport worker thread, then passed to the module's exported function.
8282
This means that the options object can only contain types that are supported by the
83-
[Structured Clone Algorithm][sca] which is used to (de)serializing objects between threads.
83+
[Structured Clone Algorithm][sca] which is used to (de)serialize objects between threads.
8484

8585
What if we wanted to use both transports, but send only error logs to `some-file-transport` while
8686
sending all logs to `my-transport.mjs`? We can use the `pino.transport` function's `destinations` option:
@@ -120,7 +120,7 @@ For more details on `pino.transport` see the [API docs for `pino.transport`][pin
120120
The module [pino-abstract-transport](https://github.com/pinojs/pino-abstract-transport) provides
121121
a simple utility to parse each line. Its usage is highly recommended.
122122
123-
You can see an example using a async iterator with ESM:
123+
You can see an example using an async iterator with ESM:
124124
125125
```js
126126
import build from 'pino-abstract-transport'
@@ -176,7 +176,7 @@ module.exports = function (opts) {
176176
To consume async iterators in batches, consider using the [hwp](https://github.com/mcollina/hwp) library.
177177
178178
The `close()` function is needed to make sure that the stream is closed and flushed when its
179-
callback is called or the returned promise resolved. Otherwise log lines will be lost.
179+
callback is called or the returned promise resolves. Otherwise, log lines will be lost.
180180
181181
### Creating a transport pipeline
182182
@@ -240,8 +240,8 @@ a terminating target, i.e. a `Writable` stream.__
240240
241241
Pino provides basic support for transports written in TypeScript.
242242
243-
Ideally, they should be transpiled to ensure maximum compatibility, but some
244-
times you might want to use tools such as TS-Node, to execute your TypeScript
243+
Ideally, they should be transpiled to ensure maximum compatibility, but sometimes
244+
you might want to use tools such as TS-Node, to execute your TypeScript
245245
code without having to go through an explicit transpilation step.
246246
247247
You can use your TypeScript code without explicit transpilation, but there are
@@ -315,7 +315,7 @@ pino(transport)
315315
### Asynchronous startup
316316
317317
The new transports boot asynchronously and calling `process.exit()` before the transport
318-
started will cause logs to not be delivered.
318+
starts will cause logs to not be delivered.
319319
320320
```js
321321
const pino = require('pino')
@@ -338,7 +338,7 @@ transport.on('ready', function () {
338338
339339
## Legacy Transports
340340
341-
A legacy Pino "transport" is a supplementary tool which consumes Pino logs.
341+
A legacy Pino "transport" is a supplementary tool that consumes Pino logs.
342342
343343
Consider the following example for creating a transport:
344344
@@ -367,11 +367,11 @@ node my-app-which-logs-stuff-to-stdout.js | node my-transport-process.js
367367
368368
Ideally, a transport should consume logs in a separate process to the application,
369369
Using transports in the same process causes unnecessary load and slows down
370-
Node's single threaded event loop.
370+
Node's single-threaded event loop.
371371
372372
## Known Transports
373373
374-
PR's to this document are welcome for any new transports!
374+
PRs to this document are welcome for any new transports!
375375
376376
### Pino v7+ Compatible
377377
@@ -460,7 +460,7 @@ $ node app.js | pino-couch -U https://couch-server -d mylogs
460460
461461
<a id="pino-datadog"></a>
462462
### pino-datadog
463-
The [pino-datadog](https://www.npmjs.com/package/pino-datadog) module is a transport that will forward logs to [DataDog](https://www.datadoghq.com/) through it's API.
463+
The [pino-datadog](https://www.npmjs.com/package/pino-datadog) module is a transport that will forward logs to [DataDog](https://www.datadoghq.com/) through its API.
464464
465465
Given an application `foo` that logs via pino, you would use `pino-datadog` like so:
466466
@@ -564,7 +564,7 @@ $ node index.js | pino-logflare --key YOUR_KEY --source YOUR_SOURCE
564564
565565
The `pino-mq` transport will take all messages received on `process.stdin` and send them over a message bus using JSON serialization.
566566
567-
This useful for:
567+
This is useful for:
568568
569569
* moving backpressure from application to broker
570570
* transforming messages pressure to another component
@@ -573,7 +573,7 @@ This useful for:
573573
node app.js | pino-mq -u "amqp://guest:guest@localhost/" -q "pino-logs"
574574
```
575575
576-
Alternatively a configuration file can be used:
576+
Alternatively, a configuration file can be used:
577577
578578
```
579579
node app.js | pino-mq -c pino-mq.json
@@ -589,8 +589,8 @@ For full documentation of command line switches and configuration see [the `pino
589589
590590
<a id="pino-loki"></a>
591591
### pino-loki
592-
pino-loki is a transport that will forwards logs into [Grafana Loki](https://grafana.com/oss/loki/)
593-
Can be used in CLI version in a separate process or in a dedicated worker :
592+
pino-loki is a transport that will forwards logs into [Grafana Loki](https://grafana.com/oss/loki/).
593+
Can be used in CLI version in a separate process or in a dedicated worker:
594594
595595
CLI :
596596
```console
@@ -607,7 +607,7 @@ const transport = pino.transport({
607607
pino(transport)
608608
```
609609
610-
For full documentation and configuration, see the [readme](https://github.com/Julien-R44/pino-loki)
610+
For full documentation and configuration, see the [readme](https://github.com/Julien-R44/pino-loki).
611611
612612
<a id="pino-papertrail"></a>
613613
### pino-papertrail
@@ -637,7 +637,7 @@ Full documentation in the [readme](https://github.com/Xstoudi/pino-pg).
637637
$ node app.js | pino-mysql -c db-configuration.json
638638
```
639639
640-
`pino-mysql` can extract and save log fields into corresponding database field
640+
`pino-mysql` can extract and save log fields into corresponding database fields
641641
and/or save the entire log stream as a [JSON Data Type][JSONDT].
642642
643643
For full documentation and command line switches read the [readme][pino-mysql].
@@ -668,7 +668,7 @@ $ node app.js | pino-redis -U redis://username:password@localhost:6379
668668
$ node app.js | pino-sentry --dsn=https://******@sentry.io/12345
669669
```
670670
671-
For full documentation of command line switches see the [pino-sentry readme](https://github.com/aandrewww/pino-sentry/blob/master/README.md)
671+
For full documentation of command line switches see the [pino-sentry readme](https://github.com/aandrewww/pino-sentry/blob/master/README.md).
672672
673673
[pino-sentry]: https://www.npmjs.com/package/pino-sentry
674674
[Sentry]: https://sentry.io/
@@ -742,7 +742,7 @@ const transport = pino.transport({
742742
projectId: 1,
743743
projectKey: "REPLACE_ME",
744744
environment: "production",
745-
// aditional options for airbrake
745+
// additional options for airbrake
746746
performanceStats: false,
747747
},
748748
},
@@ -757,7 +757,7 @@ pino(transport)
757757
<a id="pino-socket"></a>
758758
### pino-socket
759759
760-
[pino-socket][pino-socket] is a transport that will forward logs to a IPv4
760+
[pino-socket][pino-socket] is a transport that will forward logs to an IPv4
761761
UDP or TCP socket.
762762
763763
As an example, use `socat` to fake a listener:
@@ -841,9 +841,9 @@ https://github.com/deviantony/docker-elk to setup an ELK stack.
841841
842842
<a id="pino-stackdriver"></a>
843843
### pino-stackdriver
844-
The [pino-stackdriver](https://www.npmjs.com/package/pino-stackdriver) module is a transport that will forward logs to the [Google Stackdriver](https://cloud.google.com/logging/) log service through it's API.
844+
The [pino-stackdriver](https://www.npmjs.com/package/pino-stackdriver) module is a transport that will forward logs to the [Google Stackdriver](https://cloud.google.com/logging/) log service through its API.
845845
846-
Given an application `foo` that logs via pino, a stackdriver log project `bar` and credentials in the file `/credentials.json`, you would use `pino-stackdriver`
846+
Given an application `foo` that logs via pino, a stackdriver log project `bar`, and credentials in the file `/credentials.json`, you would use `pino-stackdriver`
847847
like so:
848848
849849
``` sh

‎docs/web.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Web Frameworks
22

3-
Since HTTP logging is a primary use case, Pino has first class support for the Node.js
3+
Since HTTP logging is a primary use case, Pino has first-class support for the Node.js
44
web framework ecosystem.
55

66
- [Web Frameworks](#web-frameworks)
@@ -18,7 +18,7 @@ web framework ecosystem.
1818

1919
The Fastify web framework comes bundled with Pino by default, simply set Fastify's
2020
`logger` option to `true` and use `request.log` or `reply.log` for log messages that correspond
21-
to each individual request:
21+
to each request:
2222

2323
```js
2424
const fastify = require('fastify')({
@@ -84,7 +84,7 @@ async function start () {
8484
method: 'GET',
8585
path: '/',
8686
handler: async function (request, h) {
87-
// request.log is HAPI standard way of logging
87+
// request.log is HAPI's standard way of logging
8888
request.log(['a', 'b'], 'Request into hello world')
8989

9090
// a pino instance can also be used, which will be faster

0 commit comments

Comments
 (0)
Please sign in to comment.