Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove egg logger local config #695

Merged
merged 3 commits into from
Apr 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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