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

detailed-logger

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

detailed-logger

A fast, lightweight, colorized logging framework with helpful log details like filename and line numbers

  • 0.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

detailed-logger

DetailedLogger logs the console methods to the terminal and color codes them. Most importantly, the filename and line number is included for faster debugging.

Import or Require

ESM:

import DetailedLogger from 'detailed-logger';

CommonJS:

const DetailedLogger = require('detailed-logger');

Initialization and Usage

const logger = new DetailedLogger();

logger.trace('trace');
logger.debug('debug');
logger.log('log');
logger.info('info');
logger.warn('warn');
logger.error('error');
Screenshot 2022-08-05 at 7 55 09 AM

Trace is at the highest log level and error is at the lowest. Use setLevel to adjust logging detail.

logger.setLevel('trace');  // all log messages are emitted

For less detail:

logger.setLevel('warn');  // only warn and error messages are emitted

For info, warn, and error:

logger.setLevel('info');

Note that 'info' is the default.

Run the examples in the examples folder for more in-depth understanding.

License

Copyright (c) James Mortensen, 2021-2022 MIT License

Keywords

FAQs

Package last updated on 22 Sep 2022

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