Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dot/log

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dot/log

A beautiful and minimal logger for all applications

  • 0.1.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
17K
decreased by-13.16%
Maintainers
1
Weekly downloads
 
Created
Source

@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)

FAQs

Package last updated on 29 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc