{"_id":"zlogger","_rev":"4602868","name":"zlogger","description":"The last console logger","dist-tags":{"latest":"2.1.1"},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"popomore","email":""}],"time":{"modified":"2026-04-10T17:27:30.000Z","created":"2016-11-25T18:19:25.690Z","2.1.1":"2023-08-17T13:28:51.440Z","2.1.0":"2019-02-18T06:51:26.912Z","2.0.0":"2018-12-19T08:29:42.978Z","1.1.0":"2016-12-13T10:02:44.170Z","1.0.0":"2016-11-29T07:51:15.949Z","0.0.0":"2016-11-25T18:19:25.690Z"},"users":{},"author":{"name":"popomore","email":"sakura9515@gmail.com"},"repository":{"type":"git","url":"git+ssh://git@github.com/node-modules/zlogger.git"},"versions":{"2.1.1":{"name":"zlogger","version":"2.1.1","description":"The last console logger","repository":{"type":"git","url":"git+ssh://git@github.com/node-modules/zlogger.git"},"homepage":"https://github.com/node-modules/zlogger","keywords":["logger","console","stream"],"dependencies":{"pumpify":"^1.5.1","split2":"^3.1.0","through2":"^3.0.0"},"devDependencies":{"@types/node":"^10.12.18","autod":"^3.0.1","coffee":"^5.1.1","egg-bin":"^4.9.0","egg-ci":"^1.11.0","eslint":"^5.10.0","eslint-config-egg":"^7.1.0","typescript":"^3.2.2"},"engines":{"node":">=8"},"ci":{"version":"8, 10"},"scripts":{"test":"npm run lint && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","lint":"eslint .","ci":"npm run lint && npm run cov","autod":"autod"},"author":{"name":"popomore","email":"sakura9515@gmail.com"},"license":"MIT","types":"./index.d.ts","gitHead":"21c24a8885cb28bfa0988776b39527b4b8697edb","bugs":{"url":"https://github.com/node-modules/zlogger/issues"},"_id":"zlogger@2.1.1","_nodeVersion":"16.20.1","_npmVersion":"8.19.4","dist":{"shasum":"87db02bb845e5c27648007c6cad98418929c32e3","size":3284,"noattachment":false,"key":"/zlogger/-/zlogger-2.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/zlogger/download/zlogger-2.1.1.tgz"},"_npmUser":{"name":"popomore","email":"sakura9515@gmail.com"},"directories":{},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"popomore","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/zlogger_2.1.1_1692278931264_0.7852140681115012"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-08-17T13:28:51.440Z","publish_time":1692278931440,"_source_registry_name":"default","_cnpm_publish_time":1692278931440},"2.1.0":{"name":"zlogger","version":"2.1.0","description":"The last console logger","repository":{"type":"git","url":"git+ssh://git@github.com/node-modules/zlogger.git"},"homepage":"https://github.com/node-modules/zlogger","keywords":["logger","console","stream"],"dependencies":{"pumpify":"^1.5.1","split2":"^3.1.0","through2":"^3.0.0"},"devDependencies":{"@types/node":"^10.12.18","autod":"^3.0.1","coffee":"^5.1.1","egg-bin":"^4.9.0","egg-ci":"^1.11.0","eslint":"^5.10.0","eslint-config-egg":"^7.1.0","typescript":"^3.2.2"},"engines":{"node":">=8"},"ci":{"version":"8, 10"},"scripts":{"test":"npm run lint && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","lint":"eslint .","ci":"npm run lint && npm run cov","autod":"autod"},"author":{"name":"popomore","email":"sakura9515@gmail.com"},"license":"MIT","gitHead":"56eef65508e5a341fcf03692cff9125d20fcbab4","bugs":{"url":"https://github.com/node-modules/zlogger/issues"},"_id":"zlogger@2.1.0","_npmVersion":"6.4.1","_nodeVersion":"8.4.0","_npmUser":{"name":"popomore","email":"sakura9515@gmail.com"},"dist":{"shasum":"2a612cd335a519104600db8b55b0699b94c95820","size":3596,"noattachment":false,"key":"/zlogger/-/zlogger-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/zlogger/download/zlogger-2.1.0.tgz"},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"popomore","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/zlogger_2.1.0_1550472686790_0.671608288141035"},"_hasShrinkwrap":false,"publish_time":1550472686912,"_cnpm_publish_time":1550472686912},"2.0.0":{"name":"zlogger","version":"2.0.0","description":"The last console logger","repository":{"type":"git","url":"git+ssh://git@github.com/node-modules/zlogger.git"},"homepage":"https://github.com/node-modules/zlogger","keywords":["logger","console","stream"],"dependencies":{"pumpify":"^1.5.1","split2":"^3.1.0","through2":"^3.0.0"},"devDependencies":{"autod":"^3.0.1","coffee":"^5.1.1","egg-bin":"^4.9.0","egg-ci":"^1.11.0","eslint":"^5.10.0","eslint-config-egg":"^7.1.0"},"engines":{"node":">=8"},"ci":{"version":"8, 10"},"scripts":{"test":"npm run lint && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","lint":"eslint .","ci":"npm run lint && npm run cov","autod":"autod"},"author":{"name":"popomore","email":"sakura9515@gmail.com"},"license":"MIT","gitHead":"b2cb68564f686e95ec67cd1d5d000f5a339717f2","bugs":{"url":"https://github.com/node-modules/zlogger/issues"},"_id":"zlogger@2.0.0","_npmVersion":"6.4.1","_nodeVersion":"8.4.0","_npmUser":{"name":"popomore","email":"sakura9515@gmail.com"},"dist":{"shasum":"a8c1003d62cc57b7d6e8cf2ef895de9b96992110","size":3238,"noattachment":false,"key":"/zlogger/-/zlogger-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/zlogger/download/zlogger-2.0.0.tgz"},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"popomore","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/zlogger_2.0.0_1545208182857_0.6826562751227556"},"_hasShrinkwrap":false,"publish_time":1545208182978,"_cnpm_publish_time":1545208182978},"1.1.0":{"name":"zlogger","version":"1.1.0","description":"The last console logger","repository":{"type":"git","url":"git+ssh://git@github.com/node-modules/zlogger.git"},"homepage":"https://github.com/node-modules/zlogger","keywords":["logger","console","stream"],"dependencies":{"pumpify":"^1.3.5","split2":"^2.1.0","through2":"^2.0.1"},"devDependencies":{"egg-ci":"^1.0.0","egg-bin":"^1.0.0","autod":"^2.7.1","coffee":"^3.3.0","eslint":"^3.10.2","eslint-config-egg":"^3.2.0","intelli-espower-loader":"^1.0.1","power-assert":"^1.4.2"},"engines":{"node":">=4.3.1"},"ci":{"version":"4, 6, 7"},"scripts":{"test":"npm run lint && npm run test-local","test-local":"egg-bin test -r intelli-espower-loader","cov":"egg-bin cov -r intelli-espower-loader","lint":"eslint .","ci":"npm run lint && npm run cov","autod":"autod"},"files":["index.js"],"author":{"name":"popomore","email":"sakura9515@gmail.com"},"license":"MIT","gitHead":"aaab899e6fc7bf416e1b8abae247dc0d36435e16","bugs":{"url":"https://github.com/node-modules/zlogger/issues"},"_id":"zlogger@1.1.0","_shasum":"bc0d4a1a50d88b4e027636060c7a23682754744e","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"popomore","email":"sakura9515@gmail.com"},"dist":{"shasum":"bc0d4a1a50d88b4e027636060c7a23682754744e","size":2682,"noattachment":false,"key":"/zlogger/-/zlogger-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/zlogger/download/zlogger-1.1.0.tgz"},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"popomore","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/zlogger-1.1.0.tgz_1481623363506_0.8928275026846677"},"directories":{},"publish_time":1481623364170,"_cnpm_publish_time":1481623364170,"_hasShrinkwrap":false},"1.0.0":{"name":"zlogger","version":"1.0.0","description":"The last console logger","repository":{"type":"git","url":"git+ssh://git@github.com/node-modules/zlogger.git"},"homepage":"https://github.com/node-modules/zlogger","keywords":["logger","console","stream"],"dependencies":{"pumpify":"^1.3.5","split2":"^2.1.0","through2":"^2.0.1"},"devDependencies":{"egg-ci":"^1.0.0","egg-bin":"^1.0.0","autod":"^2.7.1","coffee":"^3.3.0","eslint":"^3.10.2","eslint-config-egg":"^3.2.0","intelli-espower-loader":"^1.0.1","power-assert":"^1.4.2"},"engines":{"node":">=4.3.1"},"ci":{"version":"4, 6, 7"},"scripts":{"test":"npm run lint && npm run test-local","test-local":"egg-bin test -r intelli-espower-loader","cov":"egg-bin cov -r intelli-espower-loader","lint":"eslint .","ci":"npm run lint && npm run cov","autod":"autod"},"author":{"name":"popomore","email":"sakura9515@gmail.com"},"license":"MIT","gitHead":"fb519f7c714862bf2b97e30be85e374b34ad9ee2","bugs":{"url":"https://github.com/node-modules/zlogger/issues"},"_id":"zlogger@1.0.0","_shasum":"330b0f030e299d014296830fa30e20b94d826eb7","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"popomore","email":"sakura9515@gmail.com"},"dist":{"shasum":"330b0f030e299d014296830fa30e20b94d826eb7","size":4257,"noattachment":false,"key":"/zlogger/-/zlogger-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/zlogger/download/zlogger-1.0.0.tgz"},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"popomore","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/zlogger-1.0.0.tgz_1480405875379_0.7876211616676301"},"directories":{},"publish_time":1480405875949,"_cnpm_publish_time":1480405875949,"_hasShrinkwrap":false},"0.0.0":{"name":"zlogger","version":"0.0.0","_id":"zlogger@0.0.0","scripts":{},"_shasum":"43ae510951e12c9eae92133f22412c4dcba8ab6c","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"popomore","email":"sakura9515@gmail.com"},"dist":{"shasum":"43ae510951e12c9eae92133f22412c4dcba8ab6c","size":152,"noattachment":false,"key":"/zlogger/-/zlogger-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/zlogger/download/zlogger-0.0.0.tgz"},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"popomore","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/zlogger-0.0.0.tgz_1480097963727_0.9148246904369444"},"directories":{},"publish_time":1480097965690,"_cnpm_publish_time":1480097965690,"_hasShrinkwrap":false}},"readme":"# zlogger\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![Test coverage][codecov-image]][codecov-url]\n[![David deps][david-image]][david-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n[![npm download][download-image]][download-url]\n\n[npm-image]: https://img.shields.io/npm/v/zlogger.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/zlogger\n[travis-image]: https://img.shields.io/travis/node-modules/zlogger.svg?style=flat-square\n[travis-url]: https://travis-ci.org/node-modules/zlogger\n[codecov-image]: https://codecov.io/gh/node-modules/zlogger/branch/master/graph/badge.svg\n[codecov-url]: https://codecov.io/gh/node-modules/zlogger\n[david-image]: https://img.shields.io/david/node-modules/zlogger.svg?style=flat-square\n[david-url]: https://david-dm.org/node-modules/zlogger\n[snyk-image]: https://snyk.io/test/npm/zlogger/badge.svg?style=flat-square\n[snyk-url]: https://snyk.io/test/npm/zlogger\n[download-image]: https://img.shields.io/npm/dm/zlogger.svg?style=flat-square\n[download-url]: https://npmjs.org/package/zlogger\n\nThe last console logger\n\n## Installation\n\n```bash\nnpm install --save zlogger\n```\n\n## Feature\n\n- ✔︎ Extends [Console](https://nodejs.org/api/console.html#console_new_console_stdout_stderr)\n- ✔︎ Support custom prefix before every line\n- ✔︎ Support custom stdout and stderr\n- ✔︎ Support print time\n- ✔︎ Support child logger\n- ✔︎ Support logger level\n\n## Usage\n\nzlogger is same as global `console` which has `.log`, `.info`, `.warn`, `.error`.\n\nEvery line will start with `prefix` that you customize.\n\n```js\nconst logger = new ConsoleLogger({\n  prefix: '> ',\n});\n```\n\nSupport log level: `DEBUG` / `INFO` / `WARN` / `ERROR`.\n\n```js\nconst logger = new ConsoleLogger({\n  prefix: '> ',\n  level: 'WARN',\n});\n\nlogger.error('msg_error');\nlogger.info('msg_info');\n\n// [15:03:46] prefix > msg_error\n```\n\nSpecify stdout/stderr, default is `process.stdout/process.stderr`, you can use `fs` if you want to print to file.\n\n```js\nconst logger = new ConsoleLogger({\n  stdout: fs.createWriteStream('stdout.log'),\n  stderr: fs.createWriteStream('stderr.log'),\n});\nlogger.info('info');\nlogger.error('error');\n\n// cat stdout.log\n// cat stderr.log\n```\n\nYou can create a child logger, the first argument can be a ChildProcess or writable stream. If you give a prefix, it will print after prefix defined by the parent logger.\n\n```js\nconst cp = require('child_process');\nconst logger = new ConsoleLogger({\n  prefix: 'prefix > ',\n});\nlogger.info('see directory')\n\nconst ls = cp.spawn('ls', { cwd: __dirname });\nlogger.child(ls, '> ');\n\n// [15:03:46] prefix > see directory\n// [15:03:46] prefix > > History.md\n// [15:03:46] prefix > > README.md\n// [15:03:46] prefix > > index.js\n// [15:03:46] prefix > > node_modules\n// [15:03:46] prefix > > package.json\n// [15:03:46] prefix > > test\n```\n\n`.child` will return a new logger.\n\n```js\nconst logger = new ConsoleLogger({\n  prefix: 'parent> ',\n});\nlogger.info('parent');\n\nconst child = logger.child('child> ');\nchild.info('child');\n\n// [15:02:43] parent> parent\n// [15:02:43] parent> child> child\n```\n\nIt will print time before prefix, format is `[HH:MM:SS] `, but you can disable it.\n\n## Options\n\n- {WriteStream} stdout - stdout, `.log` and `.info` will pipe to it，default is process.stdout\n- {WriteStream} stderr - stderr, `.warn` and `.error` will pipe to it，default is process.stderr\n- {String|Function} prefix - every line will start with `prefix`, if it's a function, it will be called every line print.\n- {Boolean} time - print time\n- {String|Number} level - log level\n\n## License\n\n(The MIT License)\n","_attachments":{},"homepage":"https://github.com/node-modules/zlogger","bugs":{"url":"https://github.com/node-modules/zlogger/issues"},"license":"MIT"}