mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Send errors to Sentry if configured
This commit is contained in:
parent
5637678b48
commit
90e6c85e54
2 changed files with 15 additions and 5 deletions
|
@ -6,12 +6,21 @@ module.exports = Logger =
|
|||
name: name
|
||||
serializers: bunyan.stdSerializers
|
||||
return @
|
||||
|
||||
initializeErrorReporting: (sentry_dsn) ->
|
||||
raven = require "raven"
|
||||
@raven = new raven.Client(sentry_dsn)
|
||||
|
||||
info : ()->
|
||||
@logger.info.apply(@logger, arguments)
|
||||
log : ()->
|
||||
@logger.info.apply(@logger, arguments)
|
||||
error: ()->
|
||||
@logger.error.apply(@logger, arguments)
|
||||
error: (attributes, args...)->
|
||||
@logger.error(attributes, args...)
|
||||
if @raven?
|
||||
error = attributes.err or attributes.error
|
||||
if error?
|
||||
@raven.captureError(error, attributes)
|
||||
err: ()->
|
||||
@logger.error.apply(@logger, arguments)
|
||||
warn: ()->
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
},
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"bunyan": "1.3.6",
|
||||
"coffee-script": "1.4.0",
|
||||
"bunyan": "1.3.6"
|
||||
"raven": "^0.8.0"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue