{"id":16322745,"url":"https://github.com/shellscape/loglevelnext","last_synced_at":"2025-04-09T10:08:28.512Z","repository":{"id":49052500,"uuid":"114431455","full_name":"shellscape/loglevelnext","owner":"shellscape","description":"A modern logging library for Node.js that provides log level mapping to the console","archived":false,"fork":false,"pushed_at":"2023-10-18T02:52:52.000Z","size":845,"stargazers_count":39,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T08:09:36.729Z","etag":null,"topics":["browser-logging","browsers","console","console-error","console-info","console-log","console-logger","console-warn","log","log-level","logger","logging","loglevel"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shellscape.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-16T03:48:36.000Z","updated_at":"2024-06-09T07:27:33.000Z","dependencies_parsed_at":"2024-06-18T13:56:05.108Z","dependency_job_id":"aa848dc1-c466-4566-9b18-737d99183b53","html_url":"https://github.com/shellscape/loglevelnext","commit_stats":{"total_commits":78,"total_committers":6,"mean_commits":13.0,"dds":"0.10256410256410253","last_synced_commit":"3fd015ffd6305f709a483044d5b561938d437223"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellscape%2Floglevelnext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellscape%2Floglevelnext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellscape%2Floglevelnext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellscape%2Floglevelnext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shellscape","download_url":"https://codeload.github.com/shellscape/loglevelnext/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248018060,"owners_count":21034048,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser-logging","browsers","console","console-error","console-info","console-log","console-logger","console-warn","log","log-level","logger","logging","loglevel"],"created_at":"2024-10-10T22:52:17.396Z","updated_at":"2025-04-09T10:08:28.480Z","avatar_url":"https://github.com/shellscape.png","language":"TypeScript","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\u003cdiv align=\"center\"\u003e\n  \u003cimg width=\"150\" height=\"150\" src=\"http://shellscape.org/assets/images/external/loglevelnext-icon.svg\"\u003e\n\u003c/div\u003e\n\u003cbr/\u003e\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","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshellscape%2Floglevelnext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshellscape%2Floglevelnext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshellscape%2Floglevelnext/lists"}