Skip to content

Commit

Permalink
feat: remove egg logger local config (#695)
Browse files Browse the repository at this point in the history
  • Loading branch information
atian25 authored and popomore committed Apr 14, 2017
1 parent 1ab42e0 commit 5befb0b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 20 deletions.
12 changes: 0 additions & 12 deletions config/config.local.js

This file was deleted.

6 changes: 3 additions & 3 deletions test/app/extend/context.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand All @@ -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');
});
Expand Down
10 changes: 5 additions & 5 deletions test/lib/core/logger.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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* () {
Expand All @@ -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();
});
Expand Down

0 comments on commit 5befb0b

Please sign in to comment.