Skip to content

Commit 24e8ff0

Browse files
authoredMay 9, 2021
chore: documentation and CI updates (#183)
1 parent d9fc678 commit 24e8ff0

File tree

5 files changed

+33
-27
lines changed

5 files changed

+33
-27
lines changed
 

‎.github/dependabot.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
version: 2
22
updates:
33
- package-ecosystem: github-actions
4-
directory: "/"
4+
directory: '/'
55
schedule:
66
interval: daily
77
open-pull-requests-limit: 10
88
- package-ecosystem: npm
9-
directory: "/"
9+
directory: '/'
1010
schedule:
1111
interval: daily
1212
open-pull-requests-limit: 10

‎.github/workflows/ci.yml

+14-8
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,46 @@
11
name: CI
2+
23
on:
34
push:
45
paths-ignore:
5-
- "docs/**"
6-
- "*.md"
6+
- 'docs/**'
7+
- '*.md'
78
pull_request:
89
paths-ignore:
9-
- "docs/**"
10-
- "*.md"
10+
- 'docs/**'
11+
- '*.md'
12+
1113
jobs:
1214
build:
1315
runs-on: ubuntu-latest
1416
strategy:
1517
matrix:
16-
node-version: [10.x, 12.x, 13.x, 14.x, 16.x]
18+
node-version: [10, 12, 13, 14, 16]
1719
steps:
1820
- name: Checkout
1921
uses: actions/checkout@v2.3.4
22+
2023
- name: Use Node.js
2124
uses: actions/setup-node@v2.1.5
2225
with:
2326
node-version: ${{ matrix.node-version }}
27+
2428
- name: Restore cached dependencies
2529
uses: actions/cache@v2.1.5
2630
with:
2731
path: node_modules
2832
key: node-modules-${{ hashFiles('package.json') }}
33+
2934
- name: Install dependencies
3035
run: npm install
36+
3137
- name: Run Tests
3238
run: npm run ci
39+
3340
- name: Coveralls Parallel
3441
uses: coverallsapp/github-action@v1.1.2
3542
with:
36-
github-token: ${{ secrets.github_token }}
43+
github-token: ${{ secrets.GITHUB_TOKEN }}
3744
parallel: true
3845
flag-name: run-${{ matrix.node-version }}-${{ matrix.os }}
3946

@@ -52,6 +59,5 @@ jobs:
5259
runs-on: ubuntu-latest
5360
steps:
5461
- uses: fastify/github-action-merge-dependabot@v2.0.0
55-
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' }}
5662
with:
57-
github-token: ${{secrets.github_token}}
63+
github-token: ${{ secrets.GITHUB_TOKEN }}

‎Readme.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ $ npm install -g pino-pretty
4545
<a id="usage"></a>
4646
## Usage
4747

48-
It's recommended to use `pino-pretty` with `pino`
48+
It is recommended to use `pino-pretty` with `pino`
4949
by piping output to the CLI tool:
5050

5151
```sh
@@ -59,7 +59,7 @@ node app.js | pino-pretty
5959
- `--crlf` (`-f`): Appends carriage return and line feed, instead of just a line
6060
feed, to the formatted log line.
6161
- `--errorProps` (`-e`): When formatting an error object, display this list
62-
of properties. The list should be a comma separated list of properties Default: `''`.
62+
of properties. The list should be a comma-separated list of properties Default: `''`.
6363
- `--levelFirst` (`-l`): Display the log level name before the logged date and time.
6464
- `--errorLikeObjectKeys` (`-k`): Define the log keys that are associated with
6565
error like objects. Default: `err,error`.
@@ -73,14 +73,14 @@ node app.js | pino-pretty
7373
Default: `false`
7474
- `--timestampKey` (`-a`): Define the key that contains the log timestamp.
7575
Default: `time`.
76-
- `--translateTime` (`-t`): Translate the epoch time value into a human readable
76+
- `--translateTime` (`-t`): Translate the epoch time value into a human-readable
7777
date and time string. This flag also can set the format string to apply when
78-
translating the date to human readable format. For a list of available pattern
79-
letters see the [`dateformat` documentation](https://www.npmjs.com/package/dateformat).
78+
translating the date to a human-readable format. For a list of available pattern
79+
letters, see the [`dateformat` documentation](https://www.npmjs.com/package/dateformat).
8080
- The default format is `yyyy-mm-dd HH:MM:ss.l o` in UTC.
81-
- Require a `SYS:` prefix to translate time to the local system's timezone. A
81+
- Require a `SYS:` prefix to translate time to the local system's time zone. A
8282
shortcut `SYS:standard` to translate time to `yyyy-mm-dd HH:MM:ss.l o` in
83-
system timezone.
83+
system time zone.
8484
- `--search` (`-s`): Specify a search pattern according to
8585
[jmespath](http://jmespath.org/).
8686
- `--ignore` (`-i`): Ignore one or several keys: (`-i time,hostname`)
@@ -91,7 +91,7 @@ node app.js | pino-pretty
9191
<a id="integration"></a>
9292
## Programmatic Integration
9393

94-
We recommend against using `pino-pretty` in production, and highly
94+
We recommend against using `pino-pretty` in production and highly
9595
recommend installing `pino-pretty` as a development dependency.
9696

9797
When installed, `pino-pretty` will be used by `pino` as the default
@@ -155,7 +155,7 @@ The `colorize` default follows
155155

156156
`customPrettifiers` option provides the ability to add a custom prettify function
157157
for specific log properties. `customPrettifiers` is an object, where keys are
158-
log properties which will be prettified and value is the prettify function itself.
158+
log properties that will be prettified and value is the prettify function itself.
159159
For example, if a log line contains a `query` property,
160160
you can specify a prettifier for it:
161161
```js
@@ -170,13 +170,13 @@ const prettifyQuery = value => {
170170
}
171171
```
172172

173-
`messageFormat` option allows you to customize the message output. The format can be defined by a template `string` like this:
173+
`messageFormat` option allows you to customize the message output. A template `string` like this can define the format:
174174
```js
175175
{
176176
messageFormat: '{levelLabel} - {pid} - url:{request.url}'
177177
}
178178
```
179-
But this option can also be defined as a `function` with this prototype:
179+
This option can also be defined as a `function` with this prototype:
180180
```js
181181
{
182182
messageFormat: (log, messageKey, levelLabel) => {

‎docs/help.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@
33

44
If you run your Node.js process via [Systemd](https://www.freedesktop.org/wiki/Software/systemd/) and you examine your logs with [journalctl](https://www.freedesktop.org/software/systemd/man/journalctl.html) some data will be duplicated. You can use a combination of `journalctl` options and `pino-pretty` options to shape the output.
55

6-
For example viewing the pretified logs of a process named `monitor` with `journalctl -u monitor -f | pino-pretty`, might output something like this:
6+
For example viewing the prettified logs of a process named `monitor` with `journalctl -u monitor -f | pino-pretty`, might output something like this:
77

88
```
99
Apr 24 07:40:01 nanopi node[6080]: {"level":30,"time":1587706801902,"pid":6080,"hostname":"nanopi","msg":"TT
1010
21","v":1}
1111
```
12-
As you can see, the timestamp, hostname and pid are duplicated.
13-
If you just want the bare pretified Pino logs you can strip out the duplicate items from the `journalctl` output with the `-o cat` option of `journalctl`:
12+
As you can see, the timestamp, hostname, and pid are duplicated.
13+
If you just want the bare prettified Pino logs you can strip out the duplicate items from the `journalctl` output with the `-o cat` option of `journalctl`:
1414
```
1515
journalctl -u monitor -f -o cat | pino-pretty
1616
```
1717
the output now looks something like this:
1818
```
1919
[1587706801902] INFO (6080 on nanopi): TT 21
2020
```
21-
Making the output even more human readble by using the pino-pretty options `-t` to format the timestamp and `-i pid, hostname` to filter out hostname and pid:
21+
Make the output even more human readable by using the pino-pretty options `-t` to format the timestamp and `-i pid, hostname` to filter out hostname and pid:
2222
```
2323
[2020-04-24 05:42:24.836 +0000] INFO : TT 21
2424
```

‎package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
"pino-pretty": "./bin.js"
88
},
99
"scripts": {
10-
"ci": "standard && tap 'test/**/*.test.js' --coverage-report=lcovonly",
10+
"ci": "standard && tap \"test/**/*.test.js\" --coverage-report=lcovonly",
1111
"lint": "standard | snazzy",
12-
"test": "tap --100 'test/**/*.test.js'"
12+
"test": "tap --100 \"test/**/*.test.js\""
1313
},
1414
"repository": {
1515
"type": "git",

0 commit comments

Comments
 (0)
Please sign in to comment.