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

log

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

log

Universal pluggable logging utility

  • 6.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2M
increased by4.78%
Maintainers
1
Weekly downloads
 
Created

What is log?

The 'log' npm package is a lightweight logging library for Node.js. It provides simple logging capabilities, allowing developers to output messages to the console with various levels of severity, such as debug, info, warn, and error. It is designed to be minimalistic and straightforward to use.

What are log's main functionalities?

Logging messages with different severity levels

This feature allows developers to log messages with different levels of importance. The 'log' package provides methods like debug, info, warn, and error to categorize log messages.

const log = require('log');
log.debug('Debug message');
log.info('Information message');
log.warn('Warning message');
log.error('Error message');

Custom log levels

Developers can set a custom log level to control which messages should be output. For example, setting the log level to 'error' will only output error messages, suppressing less severe messages.

const log = require('log');
log.level = 'debug';
log.debug('This debug message will be logged');
log.level = 'error';
log.debug('This debug message will NOT be logged');

Custom log output

The 'log' package allows developers to define a custom output function for log messages. This can be used to redirect log output to a file, a remote logging service, or any other custom handling.

const log = require('log');
log.use({ write: (message) => {/* Custom logic to output message */} });

Other packages similar to log

Keywords

FAQs

Package last updated on 06 Oct 2021

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