Skip to content

Commit e1f1d62

Browse files
committed
Merge branch 'master' of github.com:pinojs/hapi-pino
2 parents 7f79d2d + 7e162ff commit e1f1d62

File tree

4 files changed

+24
-23
lines changed

4 files changed

+24
-23
lines changed

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
matrix:
1818
node: [14, 16, 18]
19-
hapi: ["@hapi/hapi@20"]
19+
hapi: ["@hapi/hapi@21"]
2020

2121
steps:
2222
- uses: actions/checkout@v2

README.md

+12-11
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@
44
[Hapi](http://hapijs.com) plugin for the [Pino](https://github.com/pinojs/pino) logger. It logs in JSON for easy
55
post-processing.
66

7-
## Supported Hapi versions
8-
9-
- hapi-pino v9.x supports Hapi v20.
10-
- hapi-pino v8.x supports Hapi v18, v19 and v20.
11-
- hapi-pino v7.x supports Hapi v18 and v19.
12-
- hapi-pino v6.x supports Hapi v17, v18 and v19
13-
- hapi-pino v5.x supports Hapi v17 and v18
14-
- hapi-pino v3.x
15-
supports Hapi v17 only. The maximum version that can be used with Hapi v16 is Pino v4.
16-
- [hapi-pino v2.x](https://github.com/pinojs/hapi-pino/tree/v2.x.x) is the LTS line for Hapi v16.
7+
## Hapi and Pino versions supported by hapi-pino
8+
9+
| hapi-pino | hapi | pino |
10+
| ------------- |:--------------|:--------------|
11+
| v12.x | v21 | v8 |
12+
| v11.x | v20 | v8 |
13+
| v9.x - v10.x | v20 | v7 |
14+
| v8.x | v18, v19, v20 | v6 |
15+
| v6.x | v17, v18, v19 | v5 |
16+
| v5.x | v17, v18 | v5 |
17+
| v3.x - v4.x | v17 | v4 |
18+
| v2.x | v16 | v4 |
1719

1820
## Install
1921

@@ -54,7 +56,6 @@ async function start () {
5456
await server.register({
5557
plugin: require('hapi-pino'),
5658
options: {
57-
prettyPrint: process.env.NODE_ENV !== 'production',
5859
// Redact Authorization headers, see https://getpino.io/#/docs/redaction
5960
redact: ['req.headers.authorization']
6061
}

index.test-d.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { Request, Server } from '@hapi/hapi';
1+
import { Request, Server, server, ServerApplicationState } from '@hapi/hapi';
22
import pino from 'pino';
33
import * as HapiPino from '.';
44
import { expectType } from 'tsd';
55

66
const pinoLogger = pino();
77

8-
const server = new Server();
8+
const hapiServer = server();
99

1010
const options: HapiPino.Options = {
1111
timestamp: () => `,"time":"${new Date(Date.now()).toISOString()}"`,
@@ -46,15 +46,15 @@ const options: HapiPino.Options = {
4646
ignoredEventTags: [{ log: ['DEBUG', 'TEST'], request: ['DEBUG', 'TEST'] }],
4747
};
4848

49-
expectType<Promise<void>>(server.register({ plugin: HapiPino, options }));
49+
expectType<Promise<Server<ServerApplicationState> & void>>(hapiServer.register({ plugin: HapiPino, options }));
5050

5151
const emptyOptions: HapiPino.Options = {};
52-
expectType<Promise<void>>(server.register({ plugin: HapiPino, options: emptyOptions }));
52+
expectType<Promise<Server<ServerApplicationState> & void>>(hapiServer.register({ plugin: HapiPino, options: emptyOptions }));
5353

54-
server.logger.info('some message');
55-
server.logger.error(new Error('some error'));
54+
hapiServer.logger.info('some message');
55+
hapiServer.logger.error(new Error('some error'));
5656

57-
server.route({
57+
hapiServer.route({
5858
method: 'GET',
5959
path: '/path',
6060
handler(request) {

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,20 @@
2121
"license": "MIT",
2222
"devDependencies": {
2323
"@hapi/code": "^9.0.0",
24-
"@hapi/hapi": "^20.2.1",
24+
"@hapi/hapi": "^21.0.0",
2525
"@hapi/lab": "^25.0.0",
26+
"@types/node": "^18.0.0",
2627
"coveralls": "^3.1.1",
2728
"flush-write-stream": "^2.0.0",
2829
"make-promises-safe": "^5.1.0",
29-
"pino-pretty": "^7.6.1",
30+
"pino-pretty": "^9.0.0",
3031
"pre-commit": "^1.2.2",
3132
"split2": "^4.1.0",
3233
"standard": "^17.0.0",
3334
"tsd": "^0.20.0"
3435
},
3536
"dependencies": {
36-
"@hapi/hoek": "^10.0.0",
37-
"@types/hapi__hapi": "^20.0.10",
37+
"@hapi/hoek": "^11.0.0",
3838
"abstract-logging": "^2.0.1",
3939
"get-caller-file": "^2.0.5",
4040
"pino": "^8.5.0"

0 commit comments

Comments
 (0)