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

clrsole

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clrsole

colorful console.log with custom appender

  • 3.0.0-beta.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2K
increased by10.75%
Maintainers
1
Weekly downloads
 
Created
Source

clrsole

npm package

Usage


const { clrsole, getLogger } = require('clrsole');

const appLogger = getLogger('app');

// logging like log4j
appLogger.trace('message', 'message2', ...);
appLogger.debug('message', 'message2', ...);
appLogger.info('message', 'message2', ...);
appLogger.warn('message', 'message2', ...);
appLogger.error('message', 'message2', ...);
appLogger.fatal('message', 'message2', ...);

// changed syslog levels
// appLogger.levels = require('graylog-sender/lib/syslog-levels');
appLogger.setLevels([
  { level: 'EMERGENCY', value: 0, color: 'magentaBright' },
  { level: 'ALERT', value: 1, color: 'magenta' },
  { level: 'CRITICAL', value: 2, color: 'redBright' },
  { level: 'ERROR', value: 3, color: 'red' },
  { level: 'WARN', value: 4, color: 'yellowBright' },
  { level: 'NOTICE', value: 5, color: 'yellow' },
  { level: 'INFO', value: 6, color: 'green' },
  { level: 'DEBUG', value: 7, color: 'cyan' }
], 'INFO');

// logging like syslog
appLogger.debug('message', 'message2');
appLogger.info('message', 'message2');
appLogger.notice('message', 'message2');
appLogger.warn('message', 'message2');
appLogger.error('message', 'message2');
appLogger.critical('message', 'message2');
appLogger.alert('message', 'message2');
appLogger.emergency('message', 'message2');

// The first param is level
appLogger.log('INFO', 'message', 'message2', ...);
appLogger.log('error', 'message', 'message2', ...);
appLogger.log('message', 'message2', ...);

clrsole.green('green message', ...);
clrsole.red('red message', ...);

Keywords

FAQs

Package last updated on 21 Mar 2020

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