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

log-driver

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

log-driver

log-driver is a simple logging framework for logging to stdout

  • 1.2.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is log-driver?

The log-driver npm package is a simple and lightweight logging utility for Node.js applications. It provides a straightforward API for logging messages at different levels (e.g., info, warn, error) and can be easily integrated into any Node.js project.

What are log-driver's main functionalities?

Basic Logging

This feature allows you to log messages at different levels such as info, warn, and error. The code sample demonstrates how to create a logger instance and log messages at various levels.

const log = require('log-driver')();
log.info('This is an info message');
log.warn('This is a warning message');
log.error('This is an error message');

Custom Log Levels

This feature allows you to define custom log levels. The code sample shows how to create a logger instance with custom levels and log messages at those levels.

const log = require('log-driver')({ levels: ['debug', 'info', 'warn', 'error', 'fatal'] });
log.debug('This is a debug message');
log.fatal('This is a fatal message');

Log Formatting

This feature allows you to customize the format of log messages. The code sample demonstrates how to create a logger instance with a custom format function that prepends a timestamp to each log message.

const log = require('log-driver')({ format: function() { return new Date().toISOString() + ' - ' + arguments[0]; } });
log.info('This is a formatted info message');

Other packages similar to log-driver

Keywords

FAQs

Package last updated on 19 Feb 2018

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