fix superfluous printing of WARN/ERROR words

This commit is contained in:
Irmen de Jong 2022-04-02 22:16:47 +02:00
parent 520a142992
commit 9874fe2c23
2 changed files with 5 additions and 5 deletions

View File

@ -1 +1 @@
8.0
8.1-dev

View File

@ -29,12 +29,12 @@ internal class ErrorReporter: IErrorReporter {
MessageSeverity.WARNING -> System.out
MessageSeverity.ERROR -> System.err
}
when(it.severity) {
MessageSeverity.ERROR -> printer.print("\u001b[91mERROR\u001B[0m ") // bright red
MessageSeverity.WARNING -> printer.print("\u001b[93mWARN\u001B[0m ") // bright yellow
}
val msg = "${it.position.toClickableStr()} ${it.message}".trim()
if(msg !in alreadyReportedMessages) {
when(it.severity) {
MessageSeverity.ERROR -> printer.print("\u001b[91mERROR\u001B[0m ") // bright red
MessageSeverity.WARNING -> printer.print("\u001b[93mWARN\u001B[0m ") // bright yellow
}
printer.println(msg)
alreadyReportedMessages.add(msg)
when(it.severity) {