Skip to content

A logger with some colors and timestamps depending on the logging level.

License

Notifications You must be signed in to change notification settings

moonstar-x/node-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6eafc37 · Jul 30, 2024

History

34 Commits
Jul 24, 2024
Jul 30, 2024
Jul 24, 2024
Jul 24, 2024
Jul 24, 2024
Jul 24, 2024
Jul 24, 2024
Jul 24, 2024
Jul 30, 2024
Jul 30, 2024
Jul 24, 2024

Repository files navigation

ci-build-status issues bundle-size version downloads-week downloads-total

@moonstar-x/logger

This is a small logging module that helps with a more organized message logging through color, logging type and timestamps.

Usage

Installation

With npm:

npm install @moonstar-x/logger

or with yarn:

yarn add @moonstar-x/logger

Importing the Package

const logger = require('@moonstar-x/logger');
import logger from '@moonstar-x/logger';

Logging Messages

You can log multiple types of messages. Objects will be serialized and stack traces will be shown.

LOG

logger.log('message to log');

INFO

logger.info('message to log');

WARN

logger.warn('message to log');

ERROR

logger.error('message to log');

FATAL

logger.fatal('message to log');

DEBUG

logger.debug('message to log');

Clear Console

You can clear the console with:

logger.clear();