{"_id":"@142vip/nest-logger","_rev":"3-4aa7169219958a86333505642e703879","name":"@142vip/nest-logger","dist-tags":{"latest":"0.0.1-alpha.3"},"versions":{"0.0.1-alpha.1":{"name":"@142vip/nest-logger","version":"0.0.1-alpha.1","keywords":["公众号搜：储凡","142vip","@142vip","@142vip/nest-logger","nest","logger"],"author":{"name":"mmdapl","email":"mmdapl@163.com"},"license":"MIT","_id":"@142vip/nest-logger@0.0.1-alpha.1","maintainers":[{"name":"mmdapl","email":"2237221210@qq.com"}],"homepage":"https://142vip.github.io/core-x/packages/nest-logger/","bugs":{"url":"https://github.com/142vip/core-x/issues"},"dist":{"shasum":"a3ac9ace82d0c33c3e15b5aedfd71e29a4260c5e","tarball":"https://registry.npmjs.org/@142vip/nest-logger/-/nest-logger-0.0.1-alpha.1.tgz","fileCount":17,"integrity":"sha512-l8rvaL9i+mzqwadmtAMC6q3AeUWwMevjdL7njp2hWudCH4ywElQpj4MOGUes6ZGoKBSMTWbd6vGmXUV26msJ0w==","signatures":[{"sig":"MEUCIQD/YF6QbLuMVlc4vqawSf9Spqw8AICdCty2iX5lV7SEHgIgFRuib+69uNLnxuwW6f+P5JjVFs3F4m7odh/RFHfuoGY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15978},"main":"./dist/index.js","_from":"file:142vip-nest-logger-0.0.1-alpha.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"private":false,"scripts":{"test":"npx jest","build":"npx nest build","typecheck":"tsc --noEmit","test:coverage":"npx jest --coverage"},"_npmUser":{"name":"mmdapl","email":"2237221210@qq.com"},"_resolved":"/tmp/da01c5241747e9b3aea6cfaf2988dba4/142vip-nest-logger-0.0.1-alpha.1.tgz","_integrity":"sha512-l8rvaL9i+mzqwadmtAMC6q3AeUWwMevjdL7njp2hWudCH4ywElQpj4MOGUes6ZGoKBSMTWbd6vGmXUV26msJ0w==","authorInfo":{"url":"https://github.com/142vip","name":"微信公众号：储凡","email":"fairy_vip@2925.com","homePage":"https://142vip.cn"},"repository":{"url":"git+https://github.com/142vip/core-x.git","type":"git","directory":"packages/nest-logger"},"_npmVersion":"10.5.0","description":"Nest.js框架日志模块，集成终端、文件等形式日志","directories":{},"sideEffects":false,"_nodeVersion":"20.12.2","dependencies":{"pino":"9.4.0","pino-http":"11.0.0","nestjs-pino":"4.4.1","pino-pretty":"11.3.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"peerDependencies":{"@142vip/nest":"0.0.1-alpha.2"},"_npmOperationalInternal":{"tmp":"tmp/nest-logger_0.0.1-alpha.1_1762243329500_0.12180248195022991","host":"s3://npm-registry-packages-npm-production"}},"0.0.1-alpha.2":{"name":"@142vip/nest-logger","version":"0.0.1-alpha.2","keywords":["公众号搜：储凡","142vip","@142vip","@142vip/nest-logger","nest","logger"],"author":{"name":"mmdapl","email":"mmdapl@163.com"},"license":"MIT","_id":"@142vip/nest-logger@0.0.1-alpha.2","maintainers":[{"name":"mmdapl","email":"2237221210@qq.com"}],"homepage":"https://142vip.github.io/core-x/packages/nest-logger/","bugs":{"url":"https://github.com/142vip/core-x/issues"},"dist":{"shasum":"fdb2be06b2664dc872356fa52169d088b0896178","tarball":"https://registry.npmjs.org/@142vip/nest-logger/-/nest-logger-0.0.1-alpha.2.tgz","fileCount":24,"integrity":"sha512-pCAyuAsyX/dTAXI41FLJdQ2Qr3ASHP2YTp3HKxWVbApaF4LrEMTRPoL+hNVBJlb7bB8bsUEY+v/UJPsJXm4Iyg==","signatures":[{"sig":"MEUCIQCO2fjIABEBpa+06xDh2dqz8ktcBMtM69qns9ys20SdPgIgRxIu4gcuguwEsQmQCrex15M7UhGPjjUPSBwnWxLmiyE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14434},"main":"./dist/index.js","_from":"file:142vip-nest-logger-0.0.1-alpha.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./index.js"}},"private":false,"scripts":{"test":"npx jest","build":"rm -rf dist && tsc -p tsconfig.json","typecheck":"tsc --noEmit","test:coverage":"npx jest --coverage"},"_npmUser":{"name":"mmdapl","email":"2237221210@qq.com"},"_resolved":"/tmp/be5b87579a34dc2a4827c88bade332b4/142vip-nest-logger-0.0.1-alpha.2.tgz","_integrity":"sha512-pCAyuAsyX/dTAXI41FLJdQ2Qr3ASHP2YTp3HKxWVbApaF4LrEMTRPoL+hNVBJlb7bB8bsUEY+v/UJPsJXm4Iyg==","authorInfo":{"url":"https://github.com/142vip","name":"微信公众号：储凡","email":"fairy_vip@2925.com","homePage":"https://142vip.cn"},"repository":{"url":"git+https://github.com/142vip/core-x.git","type":"git","directory":"packages/nest-logger"},"_npmVersion":"10.5.0","description":"Nest.js框架日志模块，集成终端、文件等形式日志","directories":{},"sideEffects":false,"_nodeVersion":"20.12.2","dependencies":{"pino":"10.1.0","pino-http":"11.0.0","nestjs-pino":"4.4.1","pino-pretty":"11.3.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"peerDependencies":{"@142vip/nest":"0.0.1-alpha.5"},"_npmOperationalInternal":{"tmp":"tmp/nest-logger_0.0.1-alpha.2_1767605394242_0.9829534594039528","host":"s3://npm-registry-packages-npm-production"}},"0.0.1-alpha.3":{"name":"@142vip/nest-logger","version":"0.0.1-alpha.3","private":false,"description":"Nest.js框架日志模块，集成终端、文件等形式日志","author":{"name":"mmdapl","email":"mmdapl@163.com"},"license":"MIT","homepage":"https://142vip.github.io/core-x/packages/nest-logger/","repository":{"type":"git","url":"git+https://github.com/142vip/core-x.git","directory":"packages/nest-logger"},"keywords":["公众号搜：储凡","142vip","@142vip","@142vip/nest-logger","nest","logger"],"sideEffects":false,"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./index.js"}},"authorInfo":{"name":"微信公众号：储凡","email":"fairy_vip@2925.com","url":"https://github.com/142vip","homePage":"https://142vip.cn"},"main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","peerDependencies":{"@142vip/nest":"0.0.1-alpha.5"},"dependencies":{"nestjs-pino":"4.4.1","pino":"10.1.0","pino-http":"11.0.0","pino-pretty":"11.3.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"scripts":{"build":"rm -rf dist && tsc -p tsconfig.json","typecheck":"tsc --noEmit","test":"npx jest","test:coverage":"npx jest --coverage"},"bugs":{"url":"https://github.com/142vip/core-x/issues"},"_id":"@142vip/nest-logger@0.0.1-alpha.3","_integrity":"sha512-Rkxyc2a29oIXo1CbWwXGJA11H25UPYcjjVVJAcvKEcroxwI1GeqHE/ylOiYk8pZAdwjbqYHuLlo0yWoGy5Em7Q==","_resolved":"/tmp/edca8a39a5556f27e48b875579e10b21/142vip-nest-logger-0.0.1-alpha.3.tgz","_from":"file:142vip-nest-logger-0.0.1-alpha.3.tgz","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-Rkxyc2a29oIXo1CbWwXGJA11H25UPYcjjVVJAcvKEcroxwI1GeqHE/ylOiYk8pZAdwjbqYHuLlo0yWoGy5Em7Q==","shasum":"cd068e22d25057f63f712c1b7b8eb753fbdbc460","tarball":"https://registry.npmjs.org/@142vip/nest-logger/-/nest-logger-0.0.1-alpha.3.tgz","fileCount":25,"unpackedSize":14652,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDR319dKxeRIiNwlGz4/928Z4EkAqFEPeuz/bAbi9vT7wIhAOniH6Gc7mNv8cmZESh1tZttt0ZNKzEPnX6q2EaXI02a"}]},"_npmUser":{"name":"mmdapl","email":"2237221210@qq.com"},"directories":{},"maintainers":[{"name":"mmdapl","email":"2237221210@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nest-logger_0.0.1-alpha.3_1767671753267_0.48605492921873816"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-04T08:02:09.393Z","modified":"2026-01-06T03:55:53.656Z","0.0.1-alpha.1":"2025-11-04T08:02:09.685Z","0.0.1-alpha.2":"2026-01-05T09:29:54.376Z","0.0.1-alpha.3":"2026-01-06T03:55:53.396Z"},"bugs":{"url":"https://github.com/142vip/core-x/issues"},"author":{"name":"mmdapl","email":"mmdapl@163.com"},"license":"MIT","homepage":"https://142vip.github.io/core-x/packages/nest-logger/","keywords":["公众号搜：储凡","142vip","@142vip","@142vip/nest-logger","nest","logger"],"repository":{"type":"git","url":"git+https://github.com/142vip/core-x.git","directory":"packages/nest-logger"},"description":"Nest.js框架日志模块，集成终端、文件等形式日志","maintainers":[{"name":"mmdapl","email":"2237221210@qq.com"}],"readme":"# @142vip/nest-logger\n\n[![NPM version](https://img.shields.io/npm/v/@142vip/nest-logger?labelColor=0b3d52&color=1da469&label=version)](https://www.npmjs.com/package/@142vip/nest-logger)\n\n## 安装\n\n```shell\n# npm\nnpm install @142vip/nest-logger\n# pnpm\npnpm i @142vip/nest-logger\n```\n\n## 配置\n\n## 日志注册\n\n```typescript\nNestLoggerModule.register({\n  consoleLogger: {\n    // ...\n  },\n  fileLogger: {\n    // ...\n  },\n})\n```\n\n## 开启日志\n\n```typescript\n// app 实例，使用Logger\nNestLoggerModule.useLogger(app)\n```\n## 日志打印\n\n### 使用 `Logger` 类，不推荐\n\n```typescript\nimport { Logger } from '@nestjs/common'\n\nexport class MyService {\n  private readonly logger = new Logger(MyService.name)\n  foo() {\n    this.logger.verbose({ foo: 'bar' }, 'baz %s', 'qux')\n    this.logger.debug('foo %s %o', 'bar', { baz: 'qux' })\n    this.logger.log('foo')\n  }\n}\n```\n\n### 使用 `InjectLogger` 装饰器，推荐\n\n```typescript\nimport { InjectLogger, NestLogger } from '@142vip/nest-logger'\n\nexport class MyService {\n  constructor(\n    private readonly logger: PinoLogger\n  ) {\n    this.logger.setContext(MyService.name)\n  }\n\n  constructor(\n    @InjectLogger(MyService.name)\n    private readonly logger: NestLogger\n  ) {}\n\n  foo() {\n    // PinoLogger has same methods as pino instance\n    this.logger.trace({ foo: 'bar' }, 'baz %s', 'qux')\n    this.logger.debug('foo %s %o', 'bar', { baz: 'qux' })\n    this.logger.info('foo')\n  }\n}\n```\n\n### 构造函数初始化\n\n```typescript\nimport { InjectLogger, NestLogger } from '@142vip/nest-logger'\n\nexport class MyService {\n  constructor(\n    private readonly logger: NestLogger\n  ) {\n    this.logger.setContext(MyService.name)\n  }\n\n  foo() {\n    this.logger.trace({ foo: 'bar' }, 'baz %s', 'qux')\n    this.logger.debug('foo %s %o', 'bar', { baz: 'qux' })\n    this.logger.info('foo')\n  }\n}\n```\n\n## 参考\n\n- [nestjs-pino](https://www.npmjs.com/package/nestjs-pino)\n- [pino](https://github.com/pinojs/pino)\n- [pino-pretty](https://github.com/pinojs/pino-pretty)\n- [pino-http](https://github.com/pinojs/pino-http)\n\n## 证书\n\n[MIT](https://opensource.org/license/MIT)\n\nCopyright (c) 2019-present, @142vip 储凡\n\n**仅供学习参考，商业使用请保留作者版权信息，作者不保证也不承担任何软件的使用风险。**\n","readmeFilename":"README.md"}