{"name":"loglevelnext","version":"5.0.6","description":"A modern logging library for Node.js and modern browsers that provides log level mapping to the console","license":"MPL-2.0","repository":{"type":"git","url":"git+https://github.com/shellscape/loglevelnext.git"},"author":{"name":"Andrew Powell","email":"andrew@shellscape.org"},"homepage":"https://github.com/shellscape/loglevelnext","main":"dist/index.js","engines":{"node":">= 12.22.1"},"scripts":{"build":"tsc --project tsconfig.json","ci:coverage":"nyc pnpm test && nyc report --reporter=text-lcov > coverage.lcov","commitlint":"commitlint","commitmsg":"commitlint -e $GIT_PARAMS","lint":"pnpm lint:docs && pnpm lint:json && pnpm lint:package && pnpm lint:js","lint-staged":"lint-staged","lint:docs":"prettier --write .github/**/*.md **/README.md","lint:js":"eslint --fix --cache src test","lint:json":"prettier --write tsconfig.*.json","lint:package":"prettier --write **/package.json --plugin=prettier-plugin-package","prepublishOnly":"pnpm build","security":"pnpm audit --audit-level high","test":"FORCE_COLOR=3 ava"},"keywords":["browser","console","debug","error","level","levels","log","logger","logging","loglevel","persist","persistent","plugins","prefix","trace","warn"],"devDependencies":{"@commitlint/cli":"12.1.4","@commitlint/config-conventional":"12.1.4","@types/node":"^15.12.2","@types/sinon":"^10.0.2","ava":"^3.15.0","chalk":"^4.0.0","eslint-config-shellscape":"^4.0.1","husky":"^4.3.8","lint-staged":"11.0.0","nyc":"^15.0.1","pre-commit":"^1.2.2","sinon":"11.1.1","ts-node":"^10.0.0","typescript":"^4.3.2"},"ava":{"extensions":["ts"],"require":["ts-node/register"],"files":["test/*.ts"]},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,js}":["eslint --fix"],"*.{json,md,yml,yaml}":["prettier --write"],"*package.json":["prettier --write --plugin=prettier-plugin-package"]},"gitHead":"27232862b1ff18dcc96d4df3b6d2d85f2b2c0a1e","bugs":{"url":"https://github.com/shellscape/loglevelnext/issues"},"_id":"loglevelnext@5.0.6","_nodeVersion":"14.15.3","_npmVersion":"6.14.9","dist":{"integrity":"sha512-GKtlPs++zQjG1DK88bpEDxP/6PlmKi5okl3T4MNq+S6bQYYWKbHKJ/kap2wwQi/24t4WfGwRnYab/8AGT4LGsg==","shasum":"abdf495dc1bfa8e9d2e1f20c61312f2fd1397085","tarball":"http://registry-npm.ywwl.com/loglevelnext/download/loglevelnext-5.0.6.tgz","fileCount":15,"unpackedSize":43112,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHAAuCRA9TVsSAnZWagAAfnYP/3cqtfISJmbWlXEnksop\nB4lcc538YIJGrTpdIc3wwub3M6Tk+J46C1IyXtttD6sDVqA6fm5j0hWr7qRH\nMpX/lvQM39Xb7y4vmPcqYzJmoKLJNGuziHbNyVj5h1VjJcVIcFbA6+Zs9gOc\nBE7Qj+6kJ23ByCqbzl8Yrn4PI/Hgzx4XMWZmZXQo4N8UtRZcAeTWP8uzfUBx\nkMGAx9I+kkdP76I0tjEj1F8iacW32wHt3+JMScu38lkld/e1vt3/TLnCwLLn\n13G+Fc4uqv02sxKQlNCltMpnFHMocBjO8honlqC1rFBt2XP7OnXbrv8OpDCN\n9Z1kPM4qEC0bwKnAxYMMv5YkJ4eG8T91Nm7fpYSOC55tTt0t5e4wm2uHVEtJ\nR9VvDfZbKBmrKkJ0hK5Vzgn6vkb9fzcd7gtVcJwKIB0oQn2XqNSEI11OWZZ2\nwajZJrmkGhsu+8ZY+95tk3yCm48v/8S7PropxRpLht5cksMuyBsrVIBGymkN\n210coMb/mpbfS+PEswQZO/WkrUlqmQrKvUnXPQNxj8Ny2t+6TIqWkBpUDSbk\n610tl6G49+JdVwKlJmLlPjm01n0JW9ufDqX4fpA7HIuiLdo3apingSPfvWPo\n3XPNufoZSs18mZ2zhBkHP9Rfg06SRkN6ZVLS3pmiRCZi00UC62+aG1U+Io5G\njA4e\r\n=wGnA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEAXPDKyRIi0qNj7Zm9Uk1MPPHovbwF+x1QKOQPWGxMSAiEAtaZj48sT+Pp9ld2g8NWHYHqib2WYSbOohIB+0oSy4rI="}],"size":13345,"noattachment":false,"key":"/loglevelnext/-/loglevelnext-5.0.6.tgz"},"_npmUser":{"name":"shellscape","email":"andrew@shellscape.org"},"directories":{},"maintainers":[{"name":"shellscape","email":"andrew@shellscape.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/loglevelnext_5.0.6_1629225005948_0.15643963976066377"},"_hasShrinkwrap":false,"readme":"[tests]: https://img.shields.io/circleci/project/github/shellscape/loglevelnext.svg\n[tests-url]: https://circleci.com/gh/shellscape/loglevelnext\n[cover]: https://codecov.io/gh/shellscape/loglevelnext/branch/master/graph/badge.svg\n[cover-url]: https://codecov.io/gh/shellscape/loglevelnext\n[size]: https://packagephobia.now.sh/badge?p=loglevelnext\n[size-url]: https://packagephobia.now.sh/result?p=loglevelnext\n[loglevel]: https://githhub.com/pimterry/loglevel\n[loglevelpre]: https://github.com/kutuluk/loglevel-plugin-prefix\n[methodfactory]: lib/factory/MethodFactory.js\n[prefixfactory]: lib/factory/PrefixFactory.js\n\n<div align=\"center\">\n  <img width=\"150\" height=\"150\" src=\"http://shellscape.org/assets/images/external/loglevelnext-icon.svg\">\n</div>\n<br/>\n\n[![tests][tests]][tests-url]\n[![cover][cover]][cover-url]\n[![size][size]][size-url]\n\n# loglevelnext\n\n`loglevelnext` is a modern logging library for Node.js and modern browsers, written with modern patterns and practices which provides log level mapping of the `console` object.\n\nFor browser use, or use in client-side applications, `loglevelnext` should be bundled by your preferred bundler or compiler, such as [Rollup](https://rollupjs.org).\n\n## Getting Started\n\nFirst thing's first, install the module:\n\n```console\nnpm install loglevelnext --save\n```\n\n## Usage\n\nUsers can choose to use `loglevelnext` in Node.js or in the client (browser).\n\n```js\nconst log = require('loglevelnext');\n\nlog.info('bananas!');\n```\n\n## Log Levels\n\nBy default `loglevelnext` ships supporting the following log level name-value\npairs:\n\n```js\n{\n  TRACE: 0,\n  DEBUG: 1,\n  INFO: 2,\n  WARN: 3,\n  ERROR: 4,\n  SILENT: 5\n}\n```\n\n## Default Logger\n\nWhen requiring `loglevelnext` in Node.js the default export will be an instance of [`LogLevel`](docs/LogLevel.md) wrapped with some extra sugar.\n\n### Methods\n\nPlease see [`LogLevel`](docs/LogLevel.md) for documentation of all methods and properties of every log instance, including the default instance.\n\n#### `trace`, `debug`, `info`, `warn`, `error`\n\nThese methods correspond to the available log levels and accept parameters identical to their `console` counterparts. e.g.\n\n```js\nconsole.info('...');\nconsole.info('...');\n// ... etc\n```\n\n#### `create(options)`\n\nReturns a new `LogLevel` instance. The `options` parameter should be an `Object` matching the options for the [`LogLevel`](docs/LogLevel.md) constructor.\n\n_Note: `LogLevel` instances created are cached. Calling `create` with a previously used `name` will return the cached `LogLevel` instance. To create a different instance with the same `name`, assign a unique `id` property to the `options` parameter._\n\n### Properties\n\n#### `factories`\n\nType: `Array [ Class ]`\n\nReturns an `Array` containing the factory classes available within `loglevelnext`\nto outside modules. Particularly useful when creating plugins. eg.\n\n```js\nconst log = require('loglevelnext');\nconst { MethodFactory } = log.factories;\nclass MyFactory extends MethodFactory { ... }\n```\n\n#### `loggers`\n\nType: `Array [ LogLevel ]`\n\nReturns an `Array` containing references to the currently instantiated loggers.\n\n## Factories aka Plugins\n\nIf you're used to using plugins with `loglevel`, fear not. The same capabilities\nare available in `loglevelnext`, but in a much more straightforward and structured\nway. `loglevelnext` supports by way of \"Factories.\" A `Factory` is nothing more\nthan a class which defines several base methods that operate on the `console`\nand provide functionality to a `LogLevel` instance. All factories must inherit from the\n[`MethodFactory`][methodfactory] class, and may override any defined class functions.\n\nFor an example factory, please have a look at the [`PrefixFactory`][prefixfactory]\nwhich provides similar functionality as the [loglevel-prefix](loglevelpre) plugin,\nand is the factory which is used when a user passes the `prefix` option to a\n`LogLevel` instance.\n\n## Browser Support\n\nAs mentioned, `loglevelnext` is a logging library for Node.js and _modern_ browsers, which means the latest versions of the major browsers. When bundling or compiling `loglevelnext` for use in a browser, you should ensure that appropriate polyfills are used. e.g. Internet Explorer typically requires polyfilling both `Symbol` and `Object.assign`.\n\n## Attribution\n\n_This project originated as a fork of the much-loved [loglevel](loglevel) module, but has diverged and has been rewritten, and now shares similarities only in functional intent._\n\nBase Log SVG by [Freepik](http://www.freepik.com/) from [www.flaticon.com](http://www.flaticon.com).\n\n## Meta\n\n[CONTRIBUTING](./.github/CONTRIBUTING)\n\n[LICENSE (Mozilla Public License)](./LICENSE)\n","publish_time":1629225006087,"_cnpm_publish_time":1629225006087,"dist-tags":{"latest":"6.0.0"}}