{"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,"readme":"# 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.txt)\n\n<!-- GITCONTRIBUTOR_START -->\n\n## Contributors\n\n|[<img src=\"https://avatars.githubusercontent.com/u/156269?v=4\" width=\"100px;\"/><br/><sub><b>fengmk2</b></sub>](https://github.com/fengmk2)<br/>|\n| :---: |\n\n\nThis project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Sat Jan 20 2024 22:39:14 GMT+0800`.\n\n<!-- GITCONTRIBUTOR_END -->\n","publish_time":1705760792285,"_cnpm_publish_time":1705760792285,"dist-tags":{"latest":"1.0.1"}}