Git Product home page Git Product logo

stunning-debug's Introduction

Stunning Debug

A stunning debug wrapper for console methods.

Installation

Install with NPM or Bower, npm install stunning-debug or bower install stunning-debug

We support CommonJS and AMD.

var _Debug = require('stunning-debug');

If used globally it's available as window._Debug

Usage

_Debug.log('Log this message!');
_Debug.warn('This is a warning!');
_Debug.error('This is an error!', errorInfo);

Methods

// Logging
_Debug.log(arg1, arg2)				// console.log()
_Debug.warn(arg1, arg2)				// console.warn()
_Debug.error(arg1, arg2)			// console.error()

// Options
_Debug.set(option|object, value)	// Set single options or multiple with an object.
_Debug.getStorage()					// Get stored debug history.
_Debug.clearStorage()				// Clear debug history

// Other methods
_Debug.on();						// Turn on console logging.
_Debug.off() 						// Turn off console logging. Storage will still be used if active.

Options

All options and their defaults.

{
	logging: true,		// Console logging, storage will still be used if active.
	storage: false,		// Storage functionality, turned off by default.
	prefix: null		// Prefix first argument in logging if it's a string.
}

Upcoming features

  • IE8 compatible debug log, which can be force-used for modern browsers.
  • Storing debug history in localStorage as an array, which could easily be forwarded to the server if you need it.
  • Gulp plugin to remove all debugging rows in your code.

stunning-debug's People

Watchers

James Cloos avatar Johan Hermansson avatar Jens Aronsson avatar

Forkers

kleopatra999

stunning-debug's Issues

Turn off debugging

For some it could be interesting to turn off logging in their production environment. For example

_Debug.on();
_Debug.off();
// or...
_Debug.set('power', false);

Events triggered on logging

It would be nice to have events triggered when for example an error is logged. Possibly interesting to send to the server for notifying the application team.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.