I had a need for an easy-to-use logger across my various NodeJS projects. This is it. If you like it, feel free also to use it. When I make releases, I push them to npm @hughescr/logger and that is probably the best/safest way to consume this package. The develop
branch and other github stuff might break compatibility at any time. master
is for releases and is what will be on npm at any given point in time, tagged with release numbers.
Install the package via npm:
npm install @hughescr/logger
Or with bun:
bun add @hughescr/logger
import { logger } from '@hughescr/logger';
logger.info('starting up');
import express from 'express';
import { middleware } from '@hughescr/logger';
const app = express();
app.use(middleware);
import { logger } from '@hughescr/logger';
logger.interceptConsole();
console.log('captured');
logger.restoreConsole();
Interested in contributing? See CONTRIBUTING.md for development setup, testing guidelines, and our git-flow branching model.