From 09814464aa2f9affa526c3591a7adafa72fa03dd Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Thu, 14 Dec 2023 11:37:20 +0100 Subject: [PATCH] Add Type Example for custom logger (#1867) Signed-off-by: Matteo Collina --- test/types/pino.test-d.ts | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/test/types/pino.test-d.ts b/test/types/pino.test-d.ts index 62fddc3e1..81ad9af09 100644 --- a/test/types/pino.test-d.ts +++ b/test/types/pino.test-d.ts @@ -333,7 +333,7 @@ pino({ crlf: true, }); -const customLevels = { foo: 99 }; +const customLevels = { foo: 99, bar: 42 } const customLevelLogger = pino({ customLevels }); @@ -378,3 +378,29 @@ try { } catch (err) { log.error({ err }) } + +const bLogger = pino({ + customLevels: { + log: 5, + }, + level: 'log', + transport: { + target: 'pino-pretty', + options: { + colorize: true, + }, + }, +}); + +expectType>(pino({ + customLevels: { + log: 5, + }, + level: 'log', + transport: { + target: 'pino-pretty', + options: { + colorize: true, + }, + }, +}))