{"id":28684893,"url":"https://github.com/node-modules/onelogger","last_synced_at":"2025-07-26T17:07:12.619Z","repository":{"id":218220552,"uuid":"745910145","full_name":"node-modules/onelogger","owner":"node-modules","description":"The only ONE logger","archived":false,"fork":false,"pushed_at":"2025-01-01T07:03:58.000Z","size":16,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-07-17T22:56:49.203Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/node-modules.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"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":"2024-01-20T14:20:40.000Z","updated_at":"2025-02-20T09:27:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"e142f79c-9a39-4966-b7b7-8df17c3a4354","html_url":"https://github.com/node-modules/onelogger","commit_stats":null,"previous_names":["node-modules/onelogger"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/node-modules/onelogger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-modules%2Fonelogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-modules%2Fonelogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-modules%2Fonelogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-modules%2Fonelogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/node-modules","download_url":"https://codeload.github.com/node-modules/onelogger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-modules%2Fonelogger/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267198680,"owners_count":24051559,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-06-14T03:07:32.069Z","updated_at":"2025-07-26T17:07:12.613Z","avatar_url":"https://github.com/node-modules.png","language":"TypeScript","readme":"# onelogger\n\n[![NPM version][npm-image]][npm-url]\n[![Node.js CI](https://github.com/node-modules/onelogger/actions/workflows/nodejs.yml/badge.svg)](https://github.com/node-modules/onelogger/actions/workflows/nodejs.yml)\n[![Test coverage][codecov-image]][codecov-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n[![npm download][download-image]][download-url]\n[![Node.js Version](https://img.shields.io/node/v/onelogger.svg?style=flat)](https://nodejs.org/en/download/)\n\n[npm-image]: https://img.shields.io/npm/v/onelogger.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/onelogger\n[codecov-image]: https://codecov.io/gh/node-modules/onelogger/branch/master/graph/badge.svg\n[codecov-url]: https://codecov.io/gh/node-modules/onelogger\n[snyk-image]: https://snyk.io/test/npm/onelogger/badge.svg?style=flat-square\n[snyk-url]: https://snyk.io/test/npm/onelogger\n[download-image]: https://img.shields.io/npm/dm/onelogger.svg?style=flat-square\n[download-url]: https://npmjs.org/package/onelogger\n\nThe only ONE logger.\n\n## Install\n\n```bash\nnpm i onelogger\n```\n\n## Usage\n\n### Get logger\n\n```ts\nimport { getLogger, getCoreLogger } from 'onelogger';\n\nconst logger = getLogger();\nlogger.info('hello world');\n// =\u003e hello world\n\n// get logger with prefix label\nconst loggerWithPrefix = getLogger('my-prefix-name1');\nloggerWithPrefix.info('hello world');\n// =\u003e [my-prefix-name1] hello world\n\n// get coreLogger\nconst coreLogger = getCoreLogger('my-prefix-name2');\ncoreLogger.info('hello world on core logger');\n// =\u003e hello world on core logger\n\n// get coreLogger with prefix label\nconst coreLoggerWithPrefix = getCoreLogger('my-prefix-name2');\ncoreLoggerWithPrefix.info('hello world on core logger');\n// =\u003e [my-prefix-name2] hello world on core logger\n```\n\n### Set custom logger\n\nThe default logger and coreLogger will pipe to `global.console`, you can change them to your real logger.\nThe custom logger must implements `ILogger` interface.\n\n```ts\nimport { setLogger, setCoreLogger, setCustomLogger } from 'onelogger';\n\nsetLogger(customLogger);\nsetCoreLogger(customCoreLogger);\nsetCustomLogger('myBizLogger', myBizLogger);\ngetCustomLogger('myBizLogger');\n```\n\n## License\n\n[MIT](LICENSE)\n\n## Contributors\n\n[![contributors](https://contrib.rocks/image?repo=node-modules/onelogger\u0026max=240\u0026columns=26)](https://github.com/node-modules/onelogger/graphs/contributors)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-modules%2Fonelogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnode-modules%2Fonelogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-modules%2Fonelogger/lists"}