Socket
Socket
Sign inDemoInstall

console-log-level

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

console-log-level

The most simple logger imaginable


Version published
Weekly downloads
494K
decreased by-2.92%
Maintainers
1
Weekly downloads
 
Created

What is console-log-level?

The console-log-level npm package is a simple logger for Node.js that allows you to log messages at different levels (trace, debug, info, warn, error, fatal). It is lightweight and easy to use, making it suitable for small to medium-sized applications where you need basic logging functionality.

What are console-log-level's main functionalities?

Basic Logging

This feature allows you to log messages at different levels such as info, warn, and error. You can set the logging level when initializing the logger.

const log = require('console-log-level')({ level: 'info' });
log.info('This is an info message');
log.warn('This is a warning message');
log.error('This is an error message');

Custom Logging Levels

This feature allows you to use custom logging levels like debug and trace, providing more granular control over the logging output.

const log = require('console-log-level')({ level: 'debug' });
log.debug('This is a debug message');
log.trace('This is a trace message');

Conditional Logging

This feature allows you to conditionally log messages based on the set logging level. In this example, only messages at the 'warn' level or higher will be logged.

const log = require('console-log-level')({ level: 'warn' });
log.info('This will not be logged');
log.warn('This will be logged');

Other packages similar to console-log-level

Keywords

FAQs

Package last updated on 08 Nov 2015

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