https://github.com/danielschaffer/debug-wrap
https://github.com/danielschaffer/debug-wrap
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/danielschaffer/debug-wrap
- Owner: DanielSchaffer
- Created: 2014-09-25T20:27:10.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-09-29T21:32:12.000Z (over 11 years ago)
- Last Synced: 2025-02-10T03:13:41.459Z (over 1 year ago)
- Language: JavaScript
- Size: 145 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
debug-wrap
==========
A wrapper around the JavaScript `console` object.
`debug-wrap` allows you to use all of the `console` object's features without worrying about browser support. It also allows you to automatically prepend a tag to all console entries, making it easier to identify the source module.
## Usage
```javascript
require(['debug-wrap'], function myModule(debugWrap) {
var debug = debugWrap('myModule'),
myObj = {},
value;
debug('here is my module');
debug('attempting to access property');
try {
value = myObj.foo.bar;
} catch (ex) {
debug.error('unable to access property', ex);
}
});
```