Add serializer to print only length of large fields in production

This commit is contained in:
Simon Detheridge 2019-07-31 15:25:54 +01:00
parent 2c0c3dc573
commit df9ca8b272
2 changed files with 12 additions and 15 deletions

View file

@ -6,8 +6,9 @@ http = require("http")
Settings = require('settings-sharelatex')
logger = require('logger-sharelatex')
logger.initialize("document-updater")
logger.logger.serializers.docs = require("./app/js/LoggerSerializers").docs
logger.logger.serializers.files = require("./app/js/LoggerSerializers").files
logger.logger.addSerializers(require("./app/js/LoggerSerializers"))
if Settings.sentry?.dsn?
logger.initializeErrorReporting(Settings.sentry.dsn)

View file

@ -1,14 +1,10 @@
module.exports =
docs: (docs) ->
docs.map (doc) ->
{
path: doc.path
id: doc.doc
}
showLength = (thing) ->
"length: #{thing?.length}"
files: (files) ->
files.map (file) ->
{
path: file.path
id: file.file
}
module.exports =
# replace long values with their length
lines: showLength
oldLines: showLength
newLines: showLength
ranges: showLength
update: showLength