提交 c407e82075e2510c51eadd3222cb98c575dad314

作者 Nick Baugh
1 个父辈 8a73c453

Removed mongoose versioning, added basics of hipchat logger (TODO)

... ... @@ -4,6 +4,7 @@
4 4 var mergeDefaults = require('merge-defaults')
5 5 var winston = require('winston')
6 6 var winstonMongoDB = require('winston-mongodb')
  7 +var winstonHipchat = require('winston-hipchat')
7 8
8 9 exports = module.exports = function(settings) {
9 10
... ... @@ -36,6 +37,19 @@ exports = module.exports = function(settings) {
36 37 )
37 38 )
38 39
  40 + // TODO: finish this
  41 + /*
  42 + if (settings.logger.hipchat)
  43 + transports.push(
  44 + new winstonMongoDB.MongoDB(
  45 + mergeDefaults(
  46 + settings.output,
  47 + settings.mongo
  48 + )
  49 + )
  50 + )
  51 + */
  52 +
39 53 var logger = new winston.Logger({
40 54 transports: transports
41 55 })
... ...
... ... @@ -15,11 +15,6 @@ exports = module.exports = function(settings) {
15 15 created_at: Date
16 16 })
17 17
18   - if (settings.mongooseVersioning)
19   - Schema.add({
20   - __versions: []
21   - })
22   -
23 18 Schema.pre('save', function(next) {
24 19
25 20 var that = this
... ... @@ -29,13 +24,6 @@ exports = module.exports = function(settings) {
29 24 if (!that.created_at)
30 25 that.created_at = that._id.getTimestamp()
31 26
32   - // version history (alternative to `mongoose-version` and `mongoose-history`)
33   - if (settings.mongooseVersioning) {
34   - var version = that.toObject()
35   - version.__v = _.isNumber(version.__v) ? version.__v + 1 : 0
36   - delete version.__versions
37   - that.__versions.push(version)
38   - }
39 27 next()
40 28 })
41 29
... ...
... ... @@ -29,6 +29,7 @@
29 29 "underscore": "~1.6.0",
30 30 "update-notifier": "git://github.com/niftylettuce/update-notifier",
31 31 "winston": "git://github.com/niftylettuce/winston",
  32 + "winston-hipchat": "^0.1.1",
32 33 "winston-mongodb": "~0.4.3"
33 34 }
34 35 }
... ...
注册登录 后发表评论