Skip to content

Commit

Permalink
fix: warnings printing by default
Browse files Browse the repository at this point in the history
  • Loading branch information
boycce committed Jun 11, 2022
1 parent f93b854 commit e1dc442
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module.exports = function(uri, opts, fn) {
manager.model = require('./model')
manager.models = models
manager.parseData = util.parseData.bind(util)
manager.warn = debug('monastery:warn')
manager.warn = debug('monastery:warn*')
manager.error = debug('monastery:error*')
manager.info = debug('monastery:info')

Expand Down
2 changes: 1 addition & 1 deletion lib/model-crud.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ module.exports = {
await util.runSeries(this.beforeUpdate.map(f => f.bind(opts, data||{})))

if (data && operators['$set']) {
this.warn(`'$set' fields take precedence over the data fields for \`${this.name}.${type}()\``)
this.info(`'$set' fields take precedence over the data fields for \`${this.name}.${type}()\``)
}
if (data || operators['$set']) {
operators['$set'] = { ...data, ...(operators['$set'] || {}) }
Expand Down
2 changes: 1 addition & 1 deletion lib/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ let Model = module.exports = function(name, opts, manager) {
if (typeof this.manager[name] === 'undefined' || typeof this.manager.model[name] !== 'undefined') {
this.manager[name] = this
} else {
this.warn(`Your model name '${name}' is conflicting, you are only able to
this.warn(`Your model name '${name}' is conflicting with an builtin manager property, you are only able to
access this model via \`db.model.${name}\``)
}

Expand Down

0 comments on commit e1dc442

Please sign in to comment.