Fastify/5/Rename Logger To Logger Instance

1.0.0Last update Sep 17, 2024
by@manishjha-04

This codemod updates the Fastify logger configuration by renaming the logger option to loggerInstance, in line with Fastify v5 changes.

Before

const logger = require('pino')();
const fastify = require('fastify')({
logger,
});

After

const loggerInstance = require('pino')();
const fastify = require('fastify')({
loggerInstance,
});

This example shows how the codemod modifies the logger option to loggerInstance, aligning with the updated configuration practices in Fastify v5.

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now