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

Enabling mongoose debug mode #707

Merged
merged 1 commit into from
Jul 26, 2015
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
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