{"_id":"onelogger","_rev":"1390823","name":"onelogger","description":"the only ONE logger","dist-tags":{"latest":"1.0.1"},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"}],"time":{"modified":"2026-09-14T01:23:24.000Z","created":"2024-01-20T14:26:32.285Z","1.0.1":"2025-01-01T07:04:03.872Z","1.0.0":"2024-01-20T16:46:04.190Z","0.0.0":"2024-01-20T14:26:32.285Z"},"users":{},"author":{"name":"fengmk2"},"repository":{"type":"git","url":"git+https://github.com/node-modules/onelogger.git"},"versions":{"1.0.1":{"name":"onelogger","version":"1.0.1","description":"the only ONE logger","dependencies":{},"devDependencies":{"@arethetypeswrong/cli":"^0.17.2","@eggjs/tsconfig":"^1.3.3","@types/mocha":"^10.0.1","@types/node":"22","egg-bin":"^6.5.2","eslint":"^8.49.0","eslint-config-egg":"^13.0.0","tshy":"^3.0.2","tshy-after":"^1.0.0","typescript":"^5.2.2"},"engines":{"node":">=16.0.0"},"scripts":{"lint":"eslint src test --ext .ts","pretest":"npm run lint -- --fix && npm run prepublishOnly","test":"npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","preci":"npm run prepublishOnly && attw --pack","ci":"npm run lint && npm run cov","prepublishOnly":"tshy && tshy-after"},"repository":{"type":"git","url":"git+https://github.com/node-modules/onelogger.git"},"keywords":["logger","onelogger","console"],"author":{"name":"fengmk2"},"license":"MIT","bugs":{"url":"https://github.com/node-modules/onelogger/issues"},"homepage":"https://github.com/node-modules/onelogger#readme","type":"module","tshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts"}},"exports":{"./package.json":"./package.json",".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}}},"types":"./dist/commonjs/index.d.ts","main":"./dist/commonjs/index.js","module":"./dist/esm/index.js","_id":"onelogger@1.0.1","gitHead":"60993df82d64d5a7e3318fa542c4ff4581ff8a0c","_nodeVersion":"18.20.5","_npmVersion":"10.8.2","dist":{"integrity":"sha512-CssDwyG8cnY8fGm9HJurr2LNScfn2u//hnxgivLMgTj+B/S2IspJbbxgFboaRJ+V0CPzi59wqTLuikMcXyVeaw==","shasum":"5b33a3eb54207494d98e63e875ad60812a24bfe4","tarball":"http://registry-npm.ywwl.com/onelogger/download/onelogger-1.0.1.tgz","fileCount":21,"unpackedSize":24638,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/onelogger@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGG13b72XxBh6NHF8uWIj1zoJkVRCbqMQTZbiMDHgUjgIgZEO3WZsEIP7PTVksupwWDfqEMzC4m7eLEriudCcrN+I="}],"size":6345,"noattachment":false,"key":"/onelogger/-/onelogger-1.0.1.tgz"},"_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"directories":{},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/onelogger_1.0.1_1735715043651_0.5923310441270957"},"_hasShrinkwrap":false,"publish_time":1735715043872,"_cnpm_publish_time":1735715043872},"1.0.0":{"name":"onelogger","version":"1.0.0","description":"the only ONE logger","dependencies":{},"devDependencies":{"@eggjs/tsconfig":"^1.3.3","@types/mocha":"^10.0.1","@types/node":"^20.6.3","git-contributor":"*","egg-bin":"^6.5.2","eslint":"^8.49.0","eslint-config-egg":"^13.0.0","tshy":"^1.1.1","tshy-after":"^1.0.0","typescript":"^5.2.2"},"engines":{"node":">=16.0.0"},"scripts":{"lint":"eslint src test --ext .ts","pretest":"npm run lint -- --fix && npm run prepublishOnly","test":"npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","preci":"npm run prepublishOnly","ci":"npm run lint && npm run cov","prepublishOnly":"tshy && tshy-after","contributor":"git-contributor"},"repository":{"type":"git","url":"git+https://github.com/node-modules/onelogger.git"},"keywords":["logger","onelogger","console"],"author":{"name":"fengmk2"},"license":"MIT","bugs":{"url":"https://github.com/node-modules/onelogger/issues"},"homepage":"https://github.com/node-modules/onelogger#readme","type":"module","tshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts"}},"exports":{"./package.json":"./package.json",".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}}},"types":"./dist/commonjs/index.d.ts","main":"./dist/commonjs/index.js","_id":"onelogger@1.0.0","gitHead":"108a34622bc5bb759b1b65fee21754532ec670d1","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-9cXcryvGm6UufEBfUCw/P7LYYkKfek/JrKwOjXi42chwcwwClmGlnxabyt0c53AaFjymzAso6zH8OHPgG92LuA==","shasum":"b901853394166dd8a6e1746dc47a95215e7c9375","tarball":"http://registry-npm.ywwl.com/onelogger/download/onelogger-1.0.0.tgz","fileCount":20,"unpackedSize":23462,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/onelogger@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF1BkgS/jrRlFD3dyg3Yuc4xDuFzUZVZyCb2OGjC/RbKAiAyMEX+MdOvgBYfeDQ7G1sLsmyRW5+9wlX1r8CZmrXylQ=="}],"size":6117,"noattachment":false,"key":"/onelogger/-/onelogger-1.0.0.tgz"},"_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"directories":{},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/onelogger_1.0.0_1705769163957_0.5984882958044722"},"_hasShrinkwrap":false,"publish_time":1705769164190,"_cnpm_publish_time":1705769164190},"0.0.0":{"name":"onelogger","version":"0.0.0","description":"the only ONE logger","main":"index.js","scripts":{"test":"egg-bin test"},"repository":{"type":"git","url":"git+https://github.com/node-modules/onelogger.git"},"keywords":["logger","onelogger","console"],"author":{"name":"fengmk2"},"license":"MIT","bugs":{"url":"https://github.com/node-modules/onelogger/issues"},"homepage":"https://github.com/node-modules/onelogger#readme","gitHead":"da83cc2c2195835b776ff8379476e7d3f512c85c","_id":"onelogger@0.0.0","_nodeVersion":"18.19.0","_npmVersion":"9.3.1","dist":{"integrity":"sha512-13qPXJwbfMTeaOi1SL8mAiu5je0FZPLtKErPS++a5Dehh1AgjyWo4C/vSjMPD5YZUV/20VKBCJIJLAjONeRotA==","shasum":"06c8c0e51d70f0ac578fe47faa29f544cce091dd","tarball":"http://registry-npm.ywwl.com/onelogger/download/onelogger-0.0.0.tgz","fileCount":3,"unpackedSize":1617,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDp966l3xoSKfpXbqLeM9W4o5rYgbztt/+7ggSRKjfecwIgbmsKj7PsykxS3WKs+i5KywwH8I9Fo+gx5rVfGDVRfs8="}],"size":1055,"noattachment":false,"key":"/onelogger/-/onelogger-0.0.0.tgz"},"_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"directories":{},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/onelogger_0.0.0_1705760792141_0.12871603900377537"},"_hasShrinkwrap":false,"publish_time":1705760792285,"_cnpm_publish_time":1705760792285}},"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// => hello world\n\n// get logger with prefix label\nconst loggerWithPrefix = getLogger('my-prefix-name1');\nloggerWithPrefix.info('hello world');\n// => [my-prefix-name1] hello world\n\n// get coreLogger\nconst coreLogger = getCoreLogger('my-prefix-name2');\ncoreLogger.info('hello world on core logger');\n// => 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// => [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&max=240&columns=26)](https://github.com/node-modules/onelogger/graphs/contributors)\n","_attachments":{},"homepage":"https://github.com/node-modules/onelogger#readme","bugs":{"url":"https://github.com/node-modules/onelogger/issues"},"license":"MIT"}