2016-06-16 06:14:45 -04:00
|
|
|
define [
|
|
|
|
"libs/latex-log-parser"
|
2016-06-16 10:29:00 -04:00
|
|
|
"ide/human-readable-logs/HumanReadableLogsRules"
|
|
|
|
], (LogParser, ruleset) ->
|
2016-06-16 06:14:45 -04:00
|
|
|
parse : (rawLog, options) ->
|
|
|
|
parsedLogEntries = LogParser.parse(rawLog, options)
|
2016-06-16 10:29:00 -04:00
|
|
|
|
2016-06-17 06:42:32 -04:00
|
|
|
_getRule = (logMessage) ->
|
|
|
|
return rule for rule in ruleset when rule.regexToMatch.test logMessage
|
2016-06-16 10:53:39 -04:00
|
|
|
|
|
|
|
for entry in parsedLogEntries.all
|
2016-06-17 06:42:32 -04:00
|
|
|
{ humanReadableHint, extraInfoURL } = _getRule entry.message
|
|
|
|
entry.humanReadableHint = humanReadableHint if humanReadableHint?
|
|
|
|
entry.extraInfoURL = extraInfoURL if extraInfoURL?
|
2016-06-16 10:29:00 -04:00
|
|
|
|
2016-06-16 06:14:45 -04:00
|
|
|
return parsedLogEntries
|