From 67e27d19eda09407a99c67ed67f4385b774643df Mon Sep 17 00:00:00 2001 From: Tom Adler Date: Fri, 29 Oct 2021 09:55:38 +0200 Subject: [PATCH 1/6] Bump pino from 6.0.0 to 7.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 53ab1bb..5d21300 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "dependencies": { "@hapi/hoek": "^9.0.0", "abstract-logging": "^2.0.0", - "pino": "^6.0.0", + "pino": "^7.0.0", "pino-pretty": "^4.0.0" }, "repository": { From bf6221d3910068e05bc39203b8f3c4aa3fba1693 Mon Sep 17 00:00:00 2001 From: Tom Adler Date: Sat, 30 Oct 2021 11:31:56 +0200 Subject: [PATCH 2/6] remove Node 10, add Node 16 --- .github/workflows/test.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0fab713..b784aec 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,13 +15,8 @@ jobs: strategy: matrix: - node: [10, 12, 14] + node: [12, 14, 16] hapi: ["@hapi/hapi@18", "@hapi/hapi@19", "@hapi/hapi@20"] - exclude: - - node: 10 - hapi: "@hapi/hapi@19" - - node: 10 - hapi: "@hapi/hapi@20" steps: - uses: actions/checkout@v2 From 70695b1f92fd37cb2b0d4b9a9577b3994487c2fd Mon Sep 17 00:00:00 2001 From: Tom Adler Date: Sat, 30 Oct 2021 12:06:08 +0200 Subject: [PATCH 3/6] remove hapi 18 and 19 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b784aec..ff8621b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: node: [12, 14, 16] - hapi: ["@hapi/hapi@18", "@hapi/hapi@19", "@hapi/hapi@20"] + hapi: ["@hapi/hapi@20"] steps: - uses: actions/checkout@v2 From 85ad50a7661e549610bd69329829a0c1715a9b4b Mon Sep 17 00:00:00 2001 From: Tom Adler Date: Sat, 30 Oct 2021 12:37:05 +0200 Subject: [PATCH 4/6] upgrade lab to pass tests on Node 16 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5d21300..06c0625 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "devDependencies": { "@hapi/code": "^8.0.0", "@hapi/hapi": "^20.0.0", - "@hapi/lab": "^23.0.0", + "@hapi/lab": "^24.3.2", "coveralls": "^3.0.11", "flush-write-stream": "^2.0.0", "make-promises-safe": "^5.1.0", From 90c43e25850a6b114fefe487ce2e61404552e0e0 Mon Sep 17 00:00:00 2001 From: Tom Adler Date: Sat, 30 Oct 2021 12:40:12 +0200 Subject: [PATCH 5/6] update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c476198..5e508b0 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ post-processing. ## Supported Hapi versions -- hapi-pino v7.x and v8.x supports Hapi v18 and v19. +- hapi-pino v8.x supports Hapi v20. (Known to work on v18 and v19, not tested anymore.) +- hapi-pino v7.x supports Hapi v18 and v19. - hapi-pino v6.x supports Hapi v17, v18 and v19 - hapi-pino v5.x supports Hapi v17 and v18 - hapi-pino v3.x From 096e8420c81908ac577b36e86218a13873362784 Mon Sep 17 00:00:00 2001 From: Tom Adler Date: Sun, 31 Oct 2021 12:04:48 +0100 Subject: [PATCH 6/6] get caller file? --- index.js | 4 ++++ package.json | 1 + 2 files changed, 5 insertions(+) diff --git a/index.js b/index.js index c89cf17..8257c2b 100644 --- a/index.js +++ b/index.js @@ -5,6 +5,7 @@ const pino = require('pino') const { stdSerializers } = pino const serializersSym = Symbol.for('pino.serializers') const nullLogger = require('abstract-logging') +const getCallerFile = require('get-caller-file') const levelTags = { trace: 'trace', @@ -46,6 +47,9 @@ async function register (server, options) { logger[serializersSym].err = options.serializers.err } } else { + if (options.transport && !options.transport.caller) { + options.transport.caller = getCallerFile() + } options.stream = options.stream || process.stdout var stream = options.stream || process.stdout logger = pino(options, stream) diff --git a/package.json b/package.json index 06c0625..0079284 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "dependencies": { "@hapi/hoek": "^9.0.0", "abstract-logging": "^2.0.0", + "get-caller-file": "^2.0.5", "pino": "^7.0.0", "pino-pretty": "^4.0.0" },