{"name":"glogg","version":"2.2.0","description":"Global logging utility","author":{"name":"Gulp Team","email":"team@gulpjs.com","url":"http://gulpjs.com/"},"contributors":[{"name":"Blaine Bublitz","email":"blaine.bublitz@gmail.com"}],"repository":{"type":"git","url":"git+https://github.com/gulpjs/glogg.git"},"license":"MIT","engines":{"node":">= 10.13.0"},"main":"index.js","scripts":{"lint":"eslint .","pretest":"npm run lint","test":"nyc mocha --async-only"},"dependencies":{"sparkles":"^2.1.0"},"devDependencies":{"eslint":"^7.32.0","eslint-config-gulp":"^5.0.1","eslint-plugin-node":"^11.1.0","expect":"^27.4.6","mocha":"^8.4.0","nyc":"^15.1.0"},"nyc":{"reporter":["lcov","text-summary"]},"prettier":{"singleQuote":true},"keywords":["global","log","logger","logging","shared"],"_id":"glogg@2.2.0","gitHead":"04a46b2477ce74dcb91d07c69740ebf8b433860c","bugs":{"url":"https://github.com/gulpjs/glogg/issues"},"homepage":"https://github.com/gulpjs/glogg#readme","_nodeVersion":"20.5.0","_npmVersion":"9.8.0","dist":{"integrity":"sha512-eWv1ds/zAlz+M1ioHsyKJomfY7jbDDPpwSkv14KQj89bycx1nvK5/2Cj/T9g7kzJcX5Bc7Yv22FjfBZS/jl94A==","shasum":"956ceb855a05a2aa1fa668d748f2be8e7361c11c","tarball":"http://registry-npm.ywwl.com/glogg/download/glogg-2.2.0.tgz","fileCount":4,"unpackedSize":6846,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCYj8G10NUqfH5RIu75EkVJAZDGwdUe0CQxnedQDbcT6AIgG23jYZwm6CT/UsAu3OBdyhqGPLyQcwUum2gp6SZCfSk="}],"size":2985,"noattachment":false,"key":"/glogg/-/glogg-2.2.0.tgz"},"_npmUser":{"name":"phated","email":"blaine.bublitz@gmail.com"},"directories":{},"maintainers":[{"name":"sttk","email":"sttk.xslet@gmail.com"},{"name":"phated","email":"blaine.bublitz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/glogg_2.2.0_1711233648050_0.9504528248412398"},"_hasShrinkwrap":false,"readme":"<p align=\"center\">\n  <a href=\"https://gulpjs.com\">\n    <img height=\"257\" width=\"114\" src=\"https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png\">\n  </a>\n</p>\n\n# glogg\n\n[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url]\n\nGlobal logging utility.\n\n## Usage\n\n```js\nvar getLogger = require('glogg');\n\nvar logger = getLogger('my-namespace');\n\n// logs strings\nlogger.debug('The MOST verbose!');\nlogger.info('Some important info');\nlogger.warn('All the warnings to you');\nlogger.error('OH NO! SOMETHING HAPPENED!');\n\n// supports util.format!\nlogger.info('%s style!', 'printf');\n\n// log anything\nlogger.debug({ my: 'obj' });\nlogger.info([1, 2, 3]);\n\n// somewhere else\nlogger.on('info', function (msg) {\n  // do something with msg\n});\n\n// must be handled to avoid crashing process\nlogger.on('error', function (msg) {\n  // now it won't crash\n});\n```\n\n## API\n\n**Note: This module makes no assumptions about the log levels and they will always\nbe emitted. If you are looking to filter some out, your listeners will need to have\nextra logic.**\n\n### getLogger([namespace])\n\nCreate a new logger at the given namespace (or the default if no namespace is provided).\nReturns an augmented [`sparkles`](https://github.com/phated/sparkles) EventEmitter object\nwith 4 methods: `debug()`, `info()`, `warn()` and `error()`. When called, these methods emit\nan event with the same name. If the first argument is a string, the arguments\nare passed through node's `util.format()` before being emitted. Other parts\nof a node program can get the logger by namespace and listen for the events to\nbe emitted.\n\n#### logger.debug(msg, ...args)\n\nEmits a `debug` event with the given `msg`.\n\nIf the first argument is a string, all arguments are passed to node's\n`util.format()` before being emitted.\n\nIf the first argument is not a string, all arguments will be emitted directly.\n\n#### logger.info(msg, ...args)\n\nEmits a `info` event with the given `msg`.\n\nIf the first argument is a string, all arguments are passed to node's\n`util.format()` before being emitted.\n\nIf the first argument is not a string, all arguments will be emitted directly.\n\n#### logger.warn(msg, ...args)\n\nEmits a `warn` event with the given `msg`.\n\nIf the first argument is a string, all arguments are passed to node's\n`util.format()` before being emitted.\n\nIf the first argument is not a string, all arguments will be emitted directly.\n\n#### logger.error(msg, ...args)\n\nEmits a `error` event with the given `msg`.\n\nIf the first argument is a string, all arguments are passed to node's\n`util.format()` before being emitted.\n\nIf the first argument is not a string, all arguments will be emitted directly.\n\n**Note: You must handle this event in some way or the node process will crash\nwhen an `error` event is emitted.**\n\n#### logger.on(event, fn)\n\nStandard API from node's `EventEmitter`. Use this to listen for events from\nthe logger methods.\n\n## License\n\nMIT\n\n<!-- prettier-ignore-start -->\n[downloads-image]: https://img.shields.io/npm/dm/glogg.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/glogg\n[npm-image]: https://img.shields.io/npm/v/glogg.svg?style=flat-square\n\n[ci-url]: https://github.com/gulpjs/glogg/actions?query=workflow:dev\n[ci-image]: https://img.shields.io/github/actions/workflow/status/gulpjs/glogg/dev.yml?style=flat-square\n\n[coveralls-url]: https://coveralls.io/r/gulpjs/glogg\n[coveralls-image]: https://img.shields.io/coveralls/gulpjs/glogg/master.svg?style=flat-square\n<!-- prettier-ignore-end -->\n","publish_time":1711233648184,"_cnpm_publish_time":1711233648184,"dist-tags":{"latest":"2.2.0"}}