{"_id":"null-logtron","_rev":"1736879","name":"null-logtron","description":"A logger that no-ops","dist-tags":{"latest":"2.2.0"},"maintainers":[{"name":"raynos","email":"raynos2@gmail.com"}],"time":{"modified":"2026-11-16T05:43:36.000Z","created":"2015-01-19T09:46:16.039Z","2.2.0":"2015-02-24T23:19:32.155Z","2.1.0":"2015-02-24T23:07:56.724Z","2.0.0":"2015-01-19T09:46:16.039Z"},"users":{},"author":{"name":"Raynos","email":"raynos2@gmail.com"},"repository":{"type":"git","url":"git://github.com/Raynos/null-logtron.git"},"versions":{"2.2.0":{"name":"null-logtron","version":"2.2.0","description":"A logger that no-ops","keywords":[],"author":{"name":"Raynos","email":"raynos2@gmail.com"},"repository":{"type":"git","url":"git://github.com/Raynos/null-logtron.git"},"main":"index.js","homepage":"https://github.com/Raynos/null-logtron","bugs":{"url":"https://github.com/Raynos/null-logtron/issues","email":"raynos2@gmail.com"},"contributors":[{"name":"Raynos"}],"dependencies":{"ringbufferjs":"0.0.1"},"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/null-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.1.0","gitHead":"995de5f6d5a96ef71195fb381b728f95f684fea3","_id":"null-logtron@2.2.0","_shasum":"9354f943016faa0ea44a99e43f425547b2c4058e","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"raynos","email":"raynos2@gmail.com"},"maintainers":[{"name":"raynos","email":"raynos2@gmail.com"}],"dist":{"shasum":"9354f943016faa0ea44a99e43f425547b2c4058e","tarball":"http://registry-npm.ywwl.com/null-logtron/download/null-logtron-2.2.0.tgz","integrity":"sha512-ESTDRP15BWx+MU69nwnH/G5aHAAgmGQNbZOJ5xzNMzbCprioJgYHoMAq4M/0k8n58HmyfcrLmMNugQgXGW52nw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDJs6KRVMCHCHpXstHQTAhRVCic852VCXImdEhl4YZKOAiEAmjvGGSXDfFsYex/39KVm5oP1ibGibCMLcpyx2kIAqac="}],"size":3948,"noattachment":false,"key":"/null-logtron/-/null-logtron-2.2.0.tgz"},"publish_time":1424819972155,"_cnpm_publish_time":1424819972155},"2.1.0":{"name":"null-logtron","version":"2.1.0","description":"A logger that no-ops","keywords":[],"author":{"name":"Raynos","email":"raynos2@gmail.com"},"repository":{"type":"git","url":"git://github.com/Raynos/null-logtron.git"},"main":"index.js","homepage":"https://github.com/Raynos/null-logtron","bugs":{"url":"https://github.com/Raynos/null-logtron/issues","email":"raynos2@gmail.com"},"contributors":[{"name":"Raynos"}],"dependencies":{"ringbufferjs":"0.0.1"},"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/null-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.1.0","gitHead":"15baf3e35f46e3eb9e213937170231570fe7d0a8","_id":"null-logtron@2.1.0","_shasum":"6d3648a15b36d6591fad7bc033db9723547f3f69","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"raynos","email":"raynos2@gmail.com"},"maintainers":[{"name":"raynos","email":"raynos2@gmail.com"}],"dist":{"shasum":"6d3648a15b36d6591fad7bc033db9723547f3f69","tarball":"http://registry-npm.ywwl.com/null-logtron/download/null-logtron-2.1.0.tgz","integrity":"sha512-loWz4I6rguSw2Hvhseg+efkXAUTGO9345GL70CnveRw2w2RVMzM2nl+zBks3EhHDPhjwdeFz0ZwoieVE+LBe+Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDQCcslLF3z5ZCmp5Y7LVGOFCYSjhyYKSxBu/acYDTzFAIgbk3yEnXyG4wyF10rFyWioFsZXJ9VccNpnUPH5vdjKVs="}],"size":3751,"noattachment":false,"key":"/null-logtron/-/null-logtron-2.1.0.tgz"},"publish_time":1424819276724,"_cnpm_publish_time":1424819276724},"2.0.0":{"name":"null-logtron","version":"2.0.0","description":"A logger that no-ops","keywords":[],"author":{"name":"Raynos","email":"raynos2@gmail.com"},"repository":{"type":"git","url":"git://github.com/Raynos/null-logtron.git"},"main":"index.js","homepage":"https://github.com/Raynos/null-logtron","bugs":{"url":"https://github.com/Raynos/null-logtron/issues","email":"raynos2@gmail.com"},"contributors":[{"name":"Raynos"}],"dependencies":{"ringbufferjs":"0.0.1"},"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/null-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.1.0","gitHead":"c80b20ff937b9437cf24c7744b34c93290e5e70b","_id":"null-logtron@2.0.0","_shasum":"c71fd2b6e861deca63c4522f7756b9fb39d482ac","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"raynos","email":"raynos2@gmail.com"},"maintainers":[{"name":"raynos","email":"raynos2@gmail.com"}],"dist":{"shasum":"c71fd2b6e861deca63c4522f7756b9fb39d482ac","tarball":"http://registry-npm.ywwl.com/null-logtron/download/null-logtron-2.0.0.tgz","integrity":"sha512-0322PM+7fYO+8zIm3wULtPRDaPMDpVTMtfJP4XZ7DstOBlQU7Zu2YLKDqf7gdxWLXVxtWjlOEGpCweC5gQ5rbw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA3WApLJTiLwld9lF9YXiJYe70A9bNv+d631JJ04OTcoAiEAwO3fa7OG53vcS43At5z5Y875B+k/KhaNsUhST2DAClM="}],"size":3719,"noattachment":false,"key":"/null-logtron/-/null-logtron-2.0.0.tgz"},"publish_time":1421660776039,"_cnpm_publish_time":1421660776039}},"readme":"# null-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 logger that no-ops\n\n## Example\n\n```js\nvar NullLogtron = require(\"null-logtron\");\n\nvar logger = NullLogtron();\nlogger.debug('some static string', { some: 'meta obj' })\nlogger.info('some static string', { some: 'meta obj' })\nlogger.warn('some static string', { some: 'meta obj' })\nlogger.error('some static string', { some: 'meta obj' })\n```\n\nThe NullLogger does not write anywhere. It actually writes\n  to a circular buffer in memory (pre-allocated to 50).\n\n## Using in tests\n\nYou can use the `.items()` method in your tests to read the\nrecords that have been written to the logger.\n\n```js\nvar NullLogtron = require('null-logtron');\nvar test = require('tape');\n\ntest('some module', function t(assert) {\n    var logger = NullLogtron();\n    var thing = new Thing({ logger: logger })\n\n    thing.doStuff();\n\n    var items = logger.items();\n    assert.equal(items.filter(function (x) {\n        return x.level === 'error'\n    }).length, 1, 'thing writes to logger.error()');\n    assert.end();\n});\n```\n\n## Motivation\n\nIf your writing a library you want the application developer\n  to pass in a logger. You cannot default a logger because that\n  breaks the unix rule of silence.\n\nSo you either need a no-op logger or you need a ton of if\n  statements. This is a cheap no-op logger.\n\nI've chosen to back it by a RingBuffer so that if you do REPL\n  into your process you can inspect the log statements.\n\nThe RingBuffer only holds 50 log records so the memory overhead\n  is trivial.\n\n## Docs\n\n// TODO. State what the module does.\n\n## Installation\n\n`npm install null-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/null-logtron.png\n  [build]: https://travis-ci.org/Raynos/null-logtron\n  [cover-png]: https://coveralls.io/repos/Raynos/null-logtron/badge.png\n  [cover]: https://coveralls.io/r/Raynos/null-logtron\n  [dep-png]: https://david-dm.org/Raynos/null-logtron.png\n  [dep]: https://david-dm.org/Raynos/null-logtron\n  [npm-png]: https://nodei.co/npm/null-logtron.png?stars&downloads\n  [npm]: https://nodei.co/npm/null-logtron\n","_attachments":{},"homepage":"https://github.com/Raynos/null-logtron","bugs":{"url":"https://github.com/Raynos/null-logtron/issues","email":"raynos2@gmail.com"}}