From b175041ecb6ed720c1fab39081cef3ed7eca42af Mon Sep 17 00:00:00 2001 From: TZ Date: Fri, 31 Mar 2017 11:56:09 +0800 Subject: [PATCH 1/2] feat: mv egg logger local config to egg-development --- config/config.local.js | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 config/config.local.js diff --git a/config/config.local.js b/config/config.local.js deleted file mode 100644 index 4cbcd2c881..0000000000 --- a/config/config.local.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -module.exports = { - logger: { - level: 'DEBUG', - consoleLevel: 'INFO', - coreLogger: { - consoleLevel: 'WARN', - }, - buffer: false, - }, -}; From f0cd1b6457a6e6b66ce2b77c7cb4e417bbb0439f Mon Sep 17 00:00:00 2001 From: popomore Date: Fri, 14 Apr 2017 00:22:54 +0800 Subject: [PATCH 2/2] f --- test/app/extend/context.test.js | 6 +++--- test/lib/core/logger.test.js | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/app/extend/context.test.js b/test/app/extend/context.test.js index 3cade4d924..e3a508b9b9 100644 --- a/test/app/extend/context.test.js +++ b/test/app/extend/context.test.js @@ -15,7 +15,7 @@ describe('test/app/extend/context.test.js', () => { let app; afterEach(() => app.close()); - it('env=local: level => debug', function* () { + it('env=local: level => info', function* () { mm.env('local'); mm.consoleLevel('NONE'); app = utils.app('apps/demo', { cache: false }); @@ -33,12 +33,12 @@ describe('test/app/extend/context.test.js', () => { errorContent.should.containEql('nodejs.Error: core error foo'); const loggerContent = fs.readFileSync(path.join(logdir, 'demo-web.log'), 'utf8'); - loggerContent.should.containEql('debug foo'); + // loggerContent.should.containEql('debug foo'); loggerContent.should.containEql('info foo'); loggerContent.should.containEql('warn foo'); const coreLoggerContent = fs.readFileSync(path.join(logdir, 'egg-web.log'), 'utf8'); - coreLoggerContent.should.containEql('core debug foo'); + // coreLoggerContent.should.containEql('core debug foo'); coreLoggerContent.should.containEql('core info foo'); coreLoggerContent.should.containEql('core warn foo'); }); diff --git a/test/lib/core/logger.test.js b/test/lib/core/logger.test.js index 1701dcb306..7c76e8abd5 100644 --- a/test/lib/core/logger.test.js +++ b/test/lib/core/logger.test.js @@ -36,10 +36,10 @@ describe('test/lib/core/logger.test.js', () => { app = utils.app('apps/mock-dev-app'); yield app.ready(); - app.logger.get('file').options.level.should.equal(Logger.DEBUG); + app.logger.get('file').options.level.should.equal(Logger.INFO); app.logger.get('console').options.level.should.equal(Logger.INFO); - app.coreLogger.get('file').options.level.should.equal(Logger.DEBUG); - app.coreLogger.get('console').options.level.should.equal(Logger.WARN); + app.coreLogger.get('file').options.level.should.equal(Logger.INFO); + app.coreLogger.get('console').options.level.should.equal(Logger.INFO); }); it('should set EGG_LOG level on local env', function* () { @@ -48,9 +48,9 @@ describe('test/lib/core/logger.test.js', () => { app = utils.app('apps/mock-dev-app'); yield app.ready(); - app.logger.get('file').options.level.should.equal(Logger.DEBUG); + app.logger.get('file').options.level.should.equal(Logger.INFO); app.logger.get('console').options.level.should.equal(Logger.ERROR); - app.coreLogger.get('file').options.level.should.equal(Logger.DEBUG); + app.coreLogger.get('file').options.level.should.equal(Logger.INFO); app.coreLogger.get('console').options.level.should.equal(Logger.ERROR); return app.ready(); });