mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-26 12:32:53 +00: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: ()->
|
||||
|
|
|
@ -3,12 +3,13 @@
|
|||
"homepage": "www.sharelatex.com",
|
||||
"description": "A centralised logging system for ShareLaTeX",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "http://github.com/sharelatex/logger-sharelatex.git"
|
||||
"type": "git",
|
||||
"url": "http://github.com/sharelatex/logger-sharelatex.git"
|
||||
},
|
||||
"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