Open officefish opened 1 year ago
I have legal pino setup levels, but when I try to declare new function for logger fastify is error with regular register method.
import { buildApp, startApp, AppOptions, buildEmpty } from './src/app' const envToLogger = { development: { transport: { target: 'pino-pretty', options: { translateTime: 'HH:MM:ss Z', ignore: 'pid,hostname', }, }, customLevels: { init: 35 } }, production: { customLevels: { init: 35 } }, test: false, } const environment = 'development' const options: AppOptions = { logger: envToLogger[environment] ?? true, pluginTimeout: 120_000 } const start = async () => { const app = await buildApp(options) await startApp(app) } start()
My attempt to extend FastifyBaseLogger which breaks fastify instance methods:
declare module 'fastify' { interface FastifyBaseLogger { init: any } }
I don't know. I guess you would need to extend the types yourself.
Maybe @kibertoad could help.
I'll take a look
I have legal pino setup levels, but when I try to declare new function for logger fastify is error with regular register method.
My attempt to extend FastifyBaseLogger which breaks fastify instance methods: