Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Merge pull request #707 from lirantal/feature/mongoose_debug_option
Browse files Browse the repository at this point in the history
Enabling mongoose debug mode
  • Loading branch information
lirantal committed Jul 26, 2015
2 parents 0faeb31 + 0bcadcc commit 4f7aed0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
4 changes: 3 additions & 1 deletion config/env/development.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ module.exports = {
options: {
user: '',
pass: ''
}
},
// Enable mongoose debug mode
debug: process.env.MONGODB_DEBUG || false
},
log: {
// Can specify one of 'combined', 'common', 'dev', 'short', 'tiny'
Expand Down
4 changes: 3 additions & 1 deletion config/env/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ module.exports = {
options: {
user: '',
pass: ''
}
},
// Enable mongoose debug mode
debug: process.env.MONGODB_DEBUG || false
},
log: {
// Can specify one of 'combined', 'common', 'dev', 'short', 'tiny'
Expand Down
4 changes: 3 additions & 1 deletion config/env/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ module.exports = {
options: {
user: '',
pass: ''
}
},
// Enable mongoose debug mode
debug: process.env.MONGODB_DEBUG || false
},
port: process.env.PORT || 3001,
app: {
Expand Down
4 changes: 4 additions & 0 deletions config/lib/mongoose.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ module.exports.connect = function(cb) {
console.error(chalk.red('Could not connect to MongoDB!'));
console.log(err);
} else {

// Enabling mongoose debug mode if required
mongoose.set('debug', config.db.debug);

// Load modules
_this.loadModels();

Expand Down

0 comments on commit 4f7aed0

Please sign in to comment.