{"name":"debug-logtron","version":"2.0.2","description":"A debug logger with a logtron interface.","keywords":[],"author":{"name":"Raynos","email":"raynos2@gmail.com"},"repository":{"type":"git","url":"git://github.com/Raynos/debug-logtron.git"},"main":"index","homepage":"https://github.com/Raynos/debug-logtron","bugs":{"url":"https://github.com/Raynos/debug-logtron/issues","email":"raynos2@gmail.com"},"contributors":[{"name":"Raynos"}],"dependencies":{"assert":"^1.3.0","circular-json":"^0.1.6","debuglog":"^1.0.1","error":"^5.0.0","process":"^0.10.0","readable-stream":"^1.0.33","util":"^0.10.3","xtend":"^4.0.0"},"devDependencies":{"coveralls":"^2.10.0","istanbul":"^0.3.5","lint-trap":"^1.0.0","opn":"^1.0.1","pre-commit":"0.0.11","tap-spec":"^2.1.1","tape":"^3.4.0"},"licenses":[{"type":"MIT","url":"http://github.com/Raynos/debug-logtron/raw/master/LICENSE"}],"scripts":{"test":"npm run jshint -s && npm run cover -s","unit-test":"node test/index.js | tap-spec","jshint":"lint-trap .","cover":"istanbul cover --report html --print detail -- test/index.js && npm run check-cover -s","check-cover":"istanbul check-coverage --branches=100 --lines=100 --functions=100","view-cover":"opn ./coverage/index.html","travis":"npm run cover -s && istanbul report lcov && ((cat coverage/lcov.info | coveralls) || exit 0)"},"engine":{"node":">= 0.8.x"},"pre-commit":["test"],"pre-commit.silent":true,"ngen-version":"5.0.0","gitHead":"a0696b33b295ea3fb30a676a6fefa5d4923b8c8e","_id":"debug-logtron@2.0.2","_shasum":"264ead80618f6c3b5ba0f4d7461f7d5ca6f6e9d2","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"raynos","email":"raynos2@gmail.com"},"maintainers":[{"name":"raynos","email":"raynos2@gmail.com"}],"dist":{"shasum":"264ead80618f6c3b5ba0f4d7461f7d5ca6f6e9d2","tarball":"http://registry-npm.ywwl.com/debug-logtron/download/debug-logtron-2.0.2.tgz","integrity":"sha512-BB3188K9aPyMbSGIdmNGR/0gLliQYlR4zxyl8eJ41hesdvRU8/IH5jp9QCiPq+XRFy2vkDKE4NOEycRaWeL/Tw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2wm0LjOzV06VSHf3bxrgNVYbrVBiA87fBJvG7G2bbogIhAKC9jLv3S2DbNY8osSywWwx5Fu3GoMHSzA37Ahyw3W4H"}],"size":5895,"noattachment":false,"key":"/debug-logtron/-/debug-logtron-2.0.2.tgz"},"readme":"# debug-logtron\n\n<!--\n    [![build status][build-png]][build]\n    [![Coverage Status][cover-png]][cover]\n    [![Davis Dependency status][dep-png]][dep]\n-->\n\n<!-- [![NPM][npm-png]][npm] -->\n\nA debug logger with a logtron interface.\n\n## Example\n\nThis logger is designed for tests; it prints info & above\nand prints debugs if you set `NODE_DEBUG=mylibrary`\n\n```js\nvar DebugLogtron = require(\"debug-logtron\");\n\nvar logger = DebugLogtron('mylibrary');\n\nlogger.debug('some fixed string', { some: 'meta object' });\nlogger.info('some fixed string', { some: 'meta object' });\nlogger.warn('some fixed string', { some: 'meta object' });\nlogger.error('some fixed string', { some: 'meta object' });\n```\n\nIt writes all logs to stderr. If you call `logger.error()` or\n`logger.fatal()` it will throw exceptions. any error callsites\nare bugs.\n\nwarns go to stderr by default.\n\n## Using in tests\n\nYou can use the `.whitelist()` and `.items()` method to make\ntesting easier\n\n```\nvar DebugLogtron = require('debug-logtron');\nvar test = require('tape');\n\ntest('some module', function t(assert) {\n    var logger = NullLogtron('mything');\n    var thing = new Thing({ logger: logger })\n\n    logger.whitelist('error', 'some msg');\n\n    thing.doStuff();\n\n    var items = logger.items();\n    assert.equal(items.filter(function (x) {\n        return x.levelName === 'error'\n    }).length, 1, 'thing writes to logger.error()');\n    assert.end();\n});\n```\n\nWhilst it is recommended that you minimize state between tests by creating\na new instance of debug-logtron, it is possible to remove a whitelisted item\nby calling `.unwhitelist` with the same arguments.\n\n## Interface\n\nThis library will re `throw` any `.error()` or `.fatal()` callsites.\n\nAny warns and infos got to stderr.\n\nAny debugs / access can be made visible using\n`NODE_DEBUG=mylibrary`.\n\nYou can turn colors off with `--color false`\n\nIf you want to see trace() logs you must set `NODE_DEBUG=mylibrary TRACE=1`\n\n## Alternatives\n\n**Warning:** This a logger for testing! Not a default logger.\n\nIf you want to add a default logger to your `dependencies`\n  then I strongly recommend you use [`null-logtron`][null-logtron]\n\n## Motivation\n\nYou want to instrument your application and your libraries\n  with a production application logger. A logger that writes\n  somewhere in production.\n\nHowever for your writing tests for both your libraries and\n  your applications you probably do not want to see all of your\n  logs spewing on STDOUT by default.\n\nThis is where `debug-logtron` comes in, You can start your app\n  or libraries with the debug logger in your tests which allows\n  the test runner to decide when to spew.\n\nThis works great together with `itape --trace` where you can\n  use `itape` to turn on and off trace mode.\n\n## Docs\n\n// TODO. State what the module does.\n\n## Installation\n\n`npm install debug-logtron`\n\n## Tests\n\n`npm test`\n\n## Contributors\n\n - Raynos\n\n## MIT Licensed\n\n  [build-png]: https://secure.travis-ci.org/Raynos/debug-logtron.png\n  [build]: https://travis-ci.org/Raynos/debug-logtron\n  [cover-png]: https://coveralls.io/repos/Raynos/debug-logtron/badge.png\n  [cover]: https://coveralls.io/r/Raynos/debug-logtron\n  [dep-png]: https://david-dm.org/Raynos/debug-logtron.png\n  [dep]: https://david-dm.org/Raynos/debug-logtron\n  [npm-png]: https://nodei.co/npm/debug-logtron.png?stars&downloads\n  [npm]: https://nodei.co/npm/debug-logtron\n  [null-logtron]: https://github.com/Raynos/null-logtron\n  [debuglog]: https://github.com/sam-github/node-debuglog\n","publish_time":1424664915609,"_cnpm_publish_time":1424664915609,"dist-tags":{"latest":"5.2.0"}}