Socket
Socket
Sign inDemoInstall

cologger

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cologger

Colorful, simple, customizable logger


Version published
Weekly downloads
7
increased by600%
Maintainers
1
Install size
4.25 kB
Created
Weekly downloads
 

Readme

Source

cologger

Colorful, simple node.js logger

usage

require

var logger = require('cologger');

settings

logger.showDebug = true;

If you set the property to false or don't specify it, debug-messages won't show.

existing log levels

// [INFO] in white
logger.info('info-message');

// [DEBUG] in cyan
logger.debug('debug-message');

// [SUCCESS] in green
logger.success('success-message');

// [WARN] in yellow
logger.warn('warn-message');

// [ERROR] in red
logger.error('error-message');
log objects
// Log objects
logger.success('Successfully created an object', { my: 'object' }, true, undefined, null, [1,2,4]);
custom log levels
logger.addLevel('custom', 'magenta');

// [CUSTOM] in magenta
logger.custom('ugly log');

logger.removeLevel('custom');
available colors
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • white

Keywords

FAQs

Last updated on 06 Dec 2013

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc