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

cloggy

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cloggy

A minimal logger object built with debug

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

cloggy

A minimal debugging utility to replace console statements with debug powered logging. This works well with libraries like redux-logger;

Getting Started

npm install cloggy

In your code, require cloggy and pass in a namespace for your debug statements.

import cloggy from 'cloggy';

const log = cloggy('app');

log.info('Doing something');
log.error('An error happened');
log.debug('Doing something');
log.log('Doing something');
log.warn('Doing something');

Debugging can be enabled with space or comma-delimited names in the following ways:

  • Browser: Open the browser console and set the following local storage item
    • localStorage.debug = '*'
    • localStorage.debug = '*,-not_this'
    • localStorage.debug = 'app:*,section:*'
  • Node: Set DEBUG environment variable
    • DEBUG=* node app.js
    • DEBUG=*,-not_this node app.js
    • DEBUG=app:*,section:* node app.js

For more information about debug, check out the docs.

Methods

The returned debug object contains the following namespaced log statements.

  • info
  • debug
  • log
  • warn
  • error

There's nothing really special about the different methods other than debug assigning unique colors per function.

Screenshot

Example running in redux-logger via custom logger object.

image

Keywords

FAQs

Package last updated on 27 Jun 2016

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