https://github.com/busterc/debugging
:eyes: this.debugging = debug + callsites + derived namespacing
https://github.com/busterc/debugging
callsite console-log debug debugger debugging logger stack stdout trace
Last synced: 12 months ago
JSON representation
:eyes: this.debugging = debug + callsites + derived namespacing
- Host: GitHub
- URL: https://github.com/busterc/debugging
- Owner: busterc
- License: isc
- Created: 2017-04-14T04:47:38.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-06-03T08:50:34.000Z (almost 6 years ago)
- Last Synced: 2025-03-21T12:56:35.983Z (about 1 year ago)
- Topics: callsite, console-log, debug, debugger, debugging, logger, stack, stdout, trace
- Language: JavaScript
- Size: 973 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# debugging [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url] [![Greenkeeper badge][greenkeeper-image]][greenkeeper-url]
> this.debugging = [debug](https://github.com/visionmedia/debug) + [callsites](https://github.com/sindresorhus/callsites) + derived namespacing
## Installation
```sh
$ npm install --save debugging
```
## Usage
```js
'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](https://about.me/buster)
[npm-image]: https://badge.fury.io/js/debugging.svg
[npm-url]: https://npmjs.org/package/debugging
[travis-image]: https://travis-ci.org/busterc/debugging.svg?branch=master
[travis-url]: https://travis-ci.org/busterc/debugging
[daviddm-image]: https://david-dm.org/busterc/debugging.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/busterc/debugging
[coveralls-image]: https://coveralls.io/repos/busterc/debugging/badge.svg
[coveralls-url]: https://coveralls.io/r/busterc/debugging
[greenkeeper-image]: https://badges.greenkeeper.io/busterc/debugging.svg
[greenkeeper-url]: https://greenkeeper.io/