From 71be753f008dee3bb1e6b427a687c5ab34a0b095 Mon Sep 17 00:00:00 2001 From: Mario Du Date: Tue, 16 Oct 2018 22:22:58 +0800 Subject: [PATCH] feat: support egg-logger 2.x --- packages/hook/package.json | 2 +- packages/hook/src/patch/EggLogger.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/hook/package.json b/packages/hook/package.json index 22a65408..c559dc5d 100644 --- a/packages/hook/package.json +++ b/packages/hook/package.json @@ -37,7 +37,7 @@ "@types/node": "^8.5.2", "bluebird": "^3.5.1", "chai": "^4.1.2", - "egg-logger": "^1.6.0", + "egg-logger": "^2.0.1", "globby": "^6.1.0", "ioredis": "^3.2.2", "log4js": "^3.0.5", diff --git a/packages/hook/src/patch/EggLogger.ts b/packages/hook/src/patch/EggLogger.ts index a16bfc46..9f720191 100644 --- a/packages/hook/src/patch/EggLogger.ts +++ b/packages/hook/src/patch/EggLogger.ts @@ -21,7 +21,7 @@ export class EggLoggerPatcher extends Patcher { const self = this; const traceManager = this.getTraceManager(); - this.hook('^1.6.x', (loadModule) => { + this.hook('^2.x||^1.6.x', (loadModule) => { const logger = loadModule('lib/logger.js'); self.getShimmer().wrap(logger.prototype, 'log', function logWrapper(log) {