Skip to content

Logging module for standard logging in Craig's node code

License

Notifications You must be signed in to change notification settings

hughescr/shared-logger

Repository files navigation

Mutation testing badge

Shared logger infrastructure

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.

Installation

Install the package via npm:

npm install @hughescr/logger

Or with bun:

bun add @hughescr/logger

Basic usage

import { logger } from '@hughescr/logger';

logger.info('starting up');

Express middleware

import express from 'express';
import { middleware } from '@hughescr/logger';

const app = express();
app.use(middleware);

Intercepting console

import { logger } from '@hughescr/logger';

logger.interceptConsole();
console.log('captured');
logger.restoreConsole();

Contributing

Interested in contributing? See CONTRIBUTING.md for development setup, testing guidelines, and our git-flow branching model.

License

This project is licensed under the Apache License 2.0 - see LICENSE.md for details.

About

Logging module for standard logging in Craig's node code

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published