@dot/log
A beautiful and minimal logger for all applications
Last updated a year ago by shellscape .
MPL-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @dot/log 
SYNC missed versions from official npm registry.

@dot/log

A beautiful and minimal logger for all applications

Requirements

This package requires an Active LTS Node version (v18+).

Install

Using npm:

npm install @dot/log --save

Usage

Create a new logger and use it to log something wild:

import { log } from '@dot/log';

log.info('Jingle Bells, Batman Smells');
log.warn('Robin laid an egg');
log.error('The Batmobile lost a wheel');
log.debug('And the Joker got away');

And there will appear magic in your console

To name the log pass the name in the getLog options:

const log = getLog({ name: 'batman' });

When logging an object the nesting can be only one level deep. If the nesting level of the object exceeds one level then a RangeError exception will be thrown.

Setting the Log Level

By default, each log instance is set to the 'info' level. The log level can be set one of two ways:

  1. By direct manipulation of the log itself, which can be useful for one-off log instances:
import { log } from '@dot/log';

log.level = 'debug'; // change from the default 'info' level
  1. Using an the DOT_LOG_LEVEL environment variable:
DOT_LOG_LEVEL=debug

Meta

CONTRIBUTING

LICENSE (Mozilla Public License)

Current Tags

  • 0.2.0                                ...           latest (a year ago)

7 Versions

  • 0.2.0                                ...           a year ago
  • 0.1.5                                ...           2 years ago
  • 0.1.4                                ...           2 years ago
  • 0.1.3                                ...           3 years ago
  • 0.1.2                                ...           3 years ago
  • 0.1.1                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (3)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |