{"maintainers":[{"name":"anonymous","email":"kent@doddsfamily.us"}],"keywords":["loglevel-plugin"],"dist-tags":{"latest":"1.0.0"},"author":{"name":"Kent C. Dodds","email":"kent@doddsfamily.us","url":"http://kentcdodds.com/"},"description":"loglevel plugin that adds colored level prefix (node only)","readme":"# loglevel-colored-level-prefix\n\nloglevel plugin that adds colored level prefix (node only)\n\n[![Build Status][build-badge]][build]\n[![Code Coverage][coverage-badge]][coverage]\n[![Dependencies][dependencyci-badge]][dependencyci]\n[![version][version-badge]][package]\n[![downloads][downloads-badge]][npm-stat]\n[![MIT License][license-badge]][LICENSE]\n\n[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors)\n[![PRs Welcome][prs-badge]][prs]\n[![Donate][donate-badge]][donate]\n[![Code of Conduct][coc-badge]][coc]\n[![Roadmap][roadmap-badge]][roadmap]\n[![Examples][examples-badge]][examples]\n\n[![Watch on GitHub][github-watch-badge]][github-watch]\n[![Star on GitHub][github-star-badge]][github-star]\n[![Tweet][twitter-badge]][twitter]\n\n## The problem\n\n[`loglevel`][loglevel] is great, and I find that I often want the log output to\nbe formatted the same way every time. Also I don't really like some of the\nimplementation of `loglevel` (specifically the fact that it uses some browser\nAPIs for some things.\n\n## This solution\n\nThis exposes a function to get a logger (singleton) with colored prefixes for\nthe level. Note that this only works in Node because it uses [`chalk`][chalk].\n\n## Installation\n\nThis module is distributed via [npm][npm] which is bundled with [node][node] and should\nbe installed as one of your project's `dependencies`:\n\n```\nnpm install --save loglevel-colored-level-prefix\n```\n\n## Usage\n\n```javascript\nconst getLogger = require('loglevel-colored-level-prefix')\nconst options = {prefix: 'your-prefix', level: 'trace'}\nconst logger = getLogger(options)\nlogger.trace('WOW! What the stack trace!?')\n// Trace: your-prefix [TRACE]: WOW! What the stack trace!?\n//     at Logger.trace (<full-path>/node_modules/loglevel-colored-level-prefix/dist/index.js:54:24)\n//     at ... etc\nlogger.debug('sup debug?')\n// your-prefix [DEBUG]: sup debug?\nlogger.info('Hey info')\n// your-prefix [INFO]: Hey info\nlogger.warn('Hi warn')\n// your-prefix [WARN]: Hi warn\nlogger.error('Hello error')\n// your-prefix [ERROR]: Hello error\n```\n\nLet's look at what that actually looks like...\n\n[![][screenshot]][screenshot]\n\n### options\n\n#### prefix\n\n**?String** - Whatever you want your prefix to be. Normally this is the tool\nthat you're logging for. The `getLogger` function will return the same instance\nof the logger based on the given prefix.\n\n#### level\n\n**?String** - What you want the initial level to be set to. This defaults to:\n`process.env.LOG_LEVEL || 'warn'`. Possible options are (in order of verbosity):\n`trace`, `debug`, `info`, `warn`, `error`.\n\n### returns\n\nAn instance of a `loglevel` logger. Learn more about that API from the\n[`loglevel` docs][loglevel].\n\n## Inspiration\n\nI wrote this because I wanted to use the plugin I created for\n[`prettier-eslint`][prettier-eslint] in\n[`prettier-eslint-cli`][prettier-eslint-cli]. And I'll probably use it in other\nprojects/tools as well.\n\n## Other Solutions\n\nI'm unaware of other plugins for `loglevel` that do what this one does. But\nthere are _many_ logging solutions out there...\n\n## Contributors\n\nThanks goes to these people ([emoji key][emojis]):\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n| [<img src=\"https://avatars.githubusercontent.com/u/1500684?v=3\" width=\"100px;\"/><br /><sub>Kent C. Dodds</sub>](https://kentcdodds.com)<br />[💻](https://github.com/kentcdodds/loglevel-colored-level-prefix/commits?author=kentcdodds) [📖](https://github.com/kentcdodds/loglevel-colored-level-prefix/commits?author=kentcdodds) 🚇 [⚠️](https://github.com/kentcdodds/loglevel-colored-level-prefix/commits?author=kentcdodds) |\n| :---: |\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n\nThis project follows the [all-contributors][all-contributors] specification. Contributions of any kind welcome!\n\n## LICENSE\n\nMIT\n\n[npm]: https://www.npmjs.com/\n[node]: https://nodejs.org\n[build-badge]: https://img.shields.io/travis/kentcdodds/loglevel-colored-level-prefix.svg?style=flat-square\n[build]: https://travis-ci.org/kentcdodds/loglevel-colored-level-prefix\n[coverage-badge]: https://img.shields.io/codecov/c/github/kentcdodds/loglevel-colored-level-prefix.svg?style=flat-square\n[coverage]: https://codecov.io/github/kentcdodds/loglevel-colored-level-prefix\n[dependencyci-badge]: https://dependencyci.com/github/kentcdodds/loglevel-colored-level-prefix/badge?style=flat-square\n[dependencyci]: https://dependencyci.com/github/kentcdodds/loglevel-colored-level-prefix\n[version-badge]: https://img.shields.io/npm/v/loglevel-colored-level-prefix.svg?style=flat-square\n[package]: https://www.npmjs.com/package/loglevel-colored-level-prefix\n[downloads-badge]: https://img.shields.io/npm/dm/loglevel-colored-level-prefix.svg?style=flat-square\n[npm-stat]: http://npm-stat.com/charts.html?package=loglevel-colored-level-prefix&from=2016-04-01\n[license-badge]: https://img.shields.io/npm/l/loglevel-colored-level-prefix.svg?style=flat-square\n[license]: https://github.com/kentcdodds/loglevel-colored-level-prefix/blob/master/other/LICENSE\n[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square\n[prs]: http://makeapullrequest.com\n[donate-badge]: https://img.shields.io/badge/$-support-green.svg?style=flat-square\n[donate]: http://kcd.im/donate\n[coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square\n[coc]: https://github.com/kentcdodds/loglevel-colored-level-prefix/blob/master/other/CODE_OF_CONDUCT.md\n[roadmap-badge]: https://img.shields.io/badge/%F0%9F%93%94-roadmap-CD9523.svg?style=flat-square\n[roadmap]: https://github.com/kentcdodds/loglevel-colored-level-prefix/blob/master/other/ROADMAP.md\n[examples-badge]: https://img.shields.io/badge/%F0%9F%92%A1-examples-8C8E93.svg?style=flat-square\n[examples]: https://github.com/kentcdodds/loglevel-colored-level-prefix/blob/master/other/EXAMPLES.md\n[github-watch-badge]: https://img.shields.io/github/watchers/kentcdodds/loglevel-colored-level-prefix.svg?style=social\n[github-watch]: https://github.com/kentcdodds/loglevel-colored-level-prefix/watchers\n[github-star-badge]: https://img.shields.io/github/stars/kentcdodds/loglevel-colored-level-prefix.svg?style=social\n[github-star]: https://github.com/kentcdodds/loglevel-colored-level-prefix/stargazers\n[twitter]: https://twitter.com/intent/tweet?text=Check%20out%20loglevel-colored-level-prefix!%20https://github.com/kentcdodds/loglevel-colored-level-prefix%20%F0%9F%91%8D\n[twitter-badge]: https://img.shields.io/twitter/url/https/github.com/kentcdodds/loglevel-colored-level-prefix.svg?style=social\n[emojis]: https://github.com/kentcdodds/all-contributors#emoji-key\n[all-contributors]: https://github.com/kentcdodds/all-contributors\n[loglevel]: https://www.npmjs.com/package/loglevel\n[prettier-eslint]: https://github.com/kentcdodds/prettier-eslint\n[prettier-eslint-cli]: https://github.com/kentcdodds/prettier-eslint-cli\n[chalk]: https://www.npmjs.com/package/chalk\n[screenshot]: https://raw.githubusercontent.com/kentcdodds/loglevel-colored-level-prefix/master/other/screenshot.png\n","repository":{"type":"git","url":"git+https://github.com/kentcdodds/loglevel-colored-level-prefix.git"},"bugs":{"url":"https://github.com/kentcdodds/loglevel-colored-level-prefix/issues"},"license":"MIT","versions":{"1.0.0":{"name":"loglevel-colored-level-prefix","version":"1.0.0","description":"loglevel plugin that adds colored level prefix (node only)","main":"dist/index.js","scripts":{"start":"nps","test":"nps test","commitmsg":"opt --in commit-msg --exec \"validate-commit-msg\"","precommit":"opt --in pre-commit --exec \"npm start validate\"","semantic-release":"semantic-release pre && npm publish && semantic-release post"},"files":["dist"],"keywords":["loglevel-plugin"],"author":{"name":"Kent C. Dodds","email":"kent@doddsfamily.us","url":"http://kentcdodds.com/"},"license":"MIT","dependencies":{"chalk":"^1.1.3","loglevel":"^1.4.1"},"devDependencies":{"all-contributors-cli":"^4.0.1","babel-cli":"^6.18.0","babel-jest":"^19.0.0","babel-preset-env":"^1.1.8","babel-preset-stage-2":"^6.18.0","babel-register":"^6.18.0","codecov":"^1.0.1","commitizen":"^2.8.6","cz-conventional-changelog":"^2.0.0","eslint":"^3.10.2","eslint-config-kentcdodds":"^11.1.0","husky":"^0.13.1","jest-cli":"^19.0.2","opt-cli":"^1.5.1","p-s":"^3.0.3","rimraf":"^2.5.4","semantic-release":"^6.3.2","validate-commit-msg":"^2.8.2"},"eslintConfig":{"extends":["kentcdodds","kentcdodds/jest"]},"jest":{"testEnvironment":"node","coverageThreshold":{"global":{"branches":100,"functions":100,"lines":100,"statements":100}}},"config":{"commitizen":{"path":"node_modules/cz-conventional-changelog"}},"repository":{"type":"git","url":"git+https://github.com/kentcdodds/loglevel-colored-level-prefix.git"},"bugs":{"url":"https://github.com/kentcdodds/loglevel-colored-level-prefix/issues"},"homepage":"https://github.com/kentcdodds/loglevel-colored-level-prefix#readme","gitHead":"b76c32554482400c00cae4413a4da4f2b493c7d7","_id":"loglevel-colored-level-prefix@1.0.0","_shasum":"6a40218fdc7ae15fc76c3d0f3e676c465388603e","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"anonymous","email":"kent@doddsfamily.us"},"dist":{"shasum":"6a40218fdc7ae15fc76c3d0f3e676c465388603e","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/loglevel-colored-level-prefix/-/loglevel-colored-level-prefix-1.0.0.tgz","integrity":"sha512-u45Wcxxc+SdAlh4yeF/uKlC1SPUPCy0gullSNKXod5I4bmifzk+Q4lSLExNEVn19tGaJipbZ4V4jbFn79/6mVA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAhuL+JRcE2bAD4biE9V2BC1g35nrZUj3n2w4O9WEzt9AiAbybiwpGfEC+x6tegR2qiv6DiP0qpDS+ywiVP+3gKOvw=="}]},"maintainers":[{"name":"anonymous","email":"kent@doddsfamily.us"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/loglevel-colored-level-prefix-1.0.0.tgz_1488219495526_0.5347940661013126"}}},"name":"loglevel-colored-level-prefix","time":{"modified":"2022-06-19T13:56:34.769Z","created":"2017-02-27T18:18:16.352Z","1.0.0":"2017-02-27T18:18:16.352Z"},"readmeFilename":"README.md","homepage":"https://github.com/kentcdodds/loglevel-colored-level-prefix#readme"}