mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
16 lines
550 B
CoffeeScript
16 lines
550 B
CoffeeScript
define [
|
|
"libs/latex-log-parser"
|
|
"ide/human-readable-logs/HumanReadableLogsRules"
|
|
], (LogParser, ruleset) ->
|
|
parse : (rawLog, options) ->
|
|
parsedLogEntries = LogParser.parse(rawLog, options)
|
|
|
|
_getRule = (logMessage) ->
|
|
return rule for rule in ruleset when rule.regexToMatch.test logMessage
|
|
|
|
for entry in parsedLogEntries.all
|
|
{ humanReadableHint, extraInfoURL } = _getRule entry.message
|
|
entry.humanReadableHint = humanReadableHint if humanReadableHint?
|
|
entry.extraInfoURL = extraInfoURL if extraInfoURL?
|
|
|
|
return parsedLogEntries
|