debugging

2.0.0 • Public • Published

debugging NPM version Build Status Dependency Status Coverage percentage Greenkeeper badge

this.debugging = debug + callsites + derived namespacing

Installation

$ npm install --save debugging

Usage

'use strict';
 
var Debugging = require('debugging');
 
var debug = new Debugging('app');
debug('info');
// => app info
 
var debugAppAuth = debug.another('auth');
debugAppAuth('more info');
// => app:auth more info
 
(function someFunction() {
  debugAppAuth.source(debugAppAuth.callsites()[0], 'even more info');
  // => app:auth some-dir/some-file.js someFunction 14 even more info
})();

API

Debugging([namespace])

  • #### namespace

    Type String

    The initial namespace to be applied to the debug logger; the default is 'app'.

another(namespace) : Debugging

  • #### namespace

    Required Type String

    A namespace to be appended to the current debug namespace

source(callsite, [info])

Log with callsite details
  • #### callsite

    Required Type: Object

  • #### info

    Type: Any

License

ISC © Buster Collings

Dependents (0)

Package Sidebar

Install

npm i debugging

Weekly Downloads

4

Version

2.0.0

License

ISC

Unpacked Size

6.36 kB

Total Files

5

Last publish

Collaborators

  • buster