{"_id":"@ashcorr/loglevel-colored-level-prefix","name":"@ashcorr/loglevel-colored-level-prefix","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@ashcorr/loglevel-colored-level-prefix","version":"1.0.0","description":"loglevel plugin that adds colored level prefix (node only)","main":"dist/index.js","scripts":{"validate":"yarn lint && yarn build && yarn test","build":"rimraf dist && babel --copy-files --out-dir dist --ignore *.test.js src","lint":"eslint .","test":"jest","test:watch":"jest --watch","semantic-release":"semantic-release","contributor:add":"all-contributors add","contributor:generate":"all-contributors generate"},"keywords":["loglevel-plugin"],"author":{"name":"Kent C. Dodds","email":"kent@doddsfamily.us","url":"http://kentcdodds.com/"},"contributors":[{"name":"Ashleigh Carr","email":"ashcorr20@gmail.com","url":"https://github.com/AshCorr"}],"license":"MIT","dependencies":{"chalk":"^4.1.2","loglevel":"^1.8.1"},"devDependencies":{"@babel/cli":"^7.8.3","@babel/core":"^7.8.3","@babel/preset-env":"^7.8.3","@babel/register":"^7.8.3","all-contributors-cli":"^6.26.0","eslint":"^8.43.0","eslint-config-kentcdodds":"^20.5.0","jest":"^29.5.0","rimraf":"^5.0.1","semantic-release":"^21.0.6"},"eslintConfig":{"extends":["kentcdodds","kentcdodds/jest"]},"repository":{"type":"git","url":"https://github.com/ashcorr/loglevel-colored-level-prefix.git"},"bugs":{"url":"https://github.com/ashcorr/loglevel-colored-level-prefix/issues"},"homepage":"https://github.com/ashcorr/loglevel-colored-level-prefix#readme","licenseText":"The MIT License (MIT)\nCopyright (c) 2016 Kent C. Dodds\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@ashcorr/loglevel-colored-level-prefix@1.0.0","dist":{"shasum":"5079821a83fb8fe15e70bf10f530d0311f35e469","integrity":"sha512-pGUu3bf55U2g3gsIFmbpyFjaowfFQk/WmyySIde3molpaXH/6WwAuvm1UlMkyAl8mwMVzu+MWYi0sXeFeA0nwg==","tarball":"https://registry.npmjs.org/@ashcorr/loglevel-colored-level-prefix/-/loglevel-colored-level-prefix-1.0.0.tgz","fileCount":8,"unpackedSize":14742,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIARASV067Pbhv3ATe8eN8vW3T/1jth/9ZlcBC6N8VeyRAiA/hf65w+9nTdzgL/pQSUzYCJPNCKlRXbLD/+s7DyVi+w=="}]},"_npmUser":{"name":"ashcorr","email":"ashcorr20@gmail.com"},"directories":{},"maintainers":[{"name":"ashcorr","email":"ashcorr20@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/loglevel-colored-level-prefix_1.0.0_1688056810027_0.6842401157158102"},"_hasShrinkwrap":false}},"time":{"created":"2023-06-29T16:40:09.895Z","1.0.0":"2023-06-29T16:40:10.261Z","modified":"2023-06-29T16:40:10.488Z"},"maintainers":[{"name":"ashcorr","email":"ashcorr20@gmail.com"}],"description":"loglevel plugin that adds colored level prefix (node only)","homepage":"https://github.com/ashcorr/loglevel-colored-level-prefix#readme","keywords":["loglevel-plugin"],"repository":{"type":"git","url":"https://github.com/ashcorr/loglevel-colored-level-prefix.git"},"contributors":[{"name":"Ashleigh Carr","email":"ashcorr20@gmail.com","url":"https://github.com/AshCorr"}],"author":{"name":"Kent C. Dodds","email":"kent@doddsfamily.us","url":"http://kentcdodds.com/"},"bugs":{"url":"https://github.com/ashcorr/loglevel-colored-level-prefix/issues"},"license":"MIT","readme":"# loglevel-colored-level-prefix\n\nForked from https://github.com/kentcdodds/loglevel-colored-level-prefix\n\nloglevel plugin that adds colored level prefix (node only)\n\n[![Build Status][build-badge]][build]\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-2-orange.svg?style=flat-square)](#contributors)\n[![PRs Welcome][prs-badge]][prs]\n[![Code of Conduct][coc-badge]][coc]\n\n[![Watch on GitHub][github-watch-badge]][github-watch]\n[![Star on GitHub][github-star-badge]][github-star]\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) | [<img src=\"https://avatars.githubusercontent.com/u/21217225?v=4\" width=\"100px;\"/><br /><sub>Ashleigh Carr</sub>](https://github.com/AshCorr)<br />[💻](https://github.com/kentcdodds/loglevel-colored-level-prefix/commits?author=AshCorr) 🚇 |\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[version-badge]: https://img.shields.io/npm/v/loglevel-colored-level-prefix.svg?style=flat-square\n[package]: https://www.npmjs.com/package/@ashcorr/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/ashcorr/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[coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square\n[coc]: https://github.com/ashcorr/loglevel-colored-level-prefix/blob/main/other/CODE_OF_CONDUCT.md\n[github-watch-badge]: https://img.shields.io/github/watchers/ashcorr/loglevel-colored-level-prefix.svg?style=social\n[github-watch]: https://github.com/ashcorr/loglevel-colored-level-prefix/watchers\n[github-star-badge]: https://img.shields.io/github/stars/ashcorr/loglevel-colored-level-prefix.svg?style=social\n[github-star]: https://github.com/ashcorr/loglevel-colored-level-prefix/stargazers\n[emojis]: https://github.com/kentcdodds/all-contributors#emoji-key\n[all-contributors]: https://github.com/all-contributors/all-contributors\n[loglevel]: https://www.npmjs.com/package/loglevel\n[prettier-eslint]: https://github.com/prettier/prettier-eslint\n[prettier-eslint-cli]: https://github.com/prettier/prettier-eslint-cli\n[chalk]: https://www.npmjs.com/package/chalk\n[screenshot]: https://raw.githubusercontent.com/ashcorr/loglevel-colored-level-prefix/main/other/screenshot.png\n","readmeFilename":"README.md"}