Skip to content

Commit

Permalink
fix: fix default logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dead-horse committed Aug 14, 2018
1 parent 6567df7 commit a966ee4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ module.exports = app => {
const defaultConfig = {
delegate: 'model',
baseDir: 'model',
logging: app.logger.info.bind(app.logger),
logging(...args) {
// if benchmark enabled, log used
const used = typeof args[1] === 'number' ? `[${args[1]}ms]` : '';
app.logger.info('[egg-sequelize]%s %s', used, args[0]);
},
host: 'localhost',
port: 3306,
username: 'root',
Expand Down

0 comments on commit a966ee4

Please sign in to comment.