Copyright (c) 2025 Michael Welter me@mikinho.com
Helper module for outputting colored info, warn, error, debug and trace/verbose log messages. Works with Fastify or standalone Node.js application.
npm install @ynode/ylogimport ylog from "@ynode/ylog";
const log = ylog(import.meta);
log.info(`[${process.pid}] Hello`);
log.warn(`[${process.pid}] Hello`);
log.error(`[${process.pid}] Hello`);const fastify = Fastify({ loggerInstance: log });
fastify.log.info(`Worker ${process.pid} shutting down due to inactivity.`);