Refactor messages sending

This commit is contained in:
Alexey Tsvetkov
2017-01-12 16:16:56 +03:00
parent e44cc43ada
commit 16352ff2e5
21 changed files with 411 additions and 401 deletions
@@ -19,30 +19,12 @@ package org.jetbrains.kotlin.cli.common.messages;
import java.util.EnumSet;
public enum CompilerMessageSeverity {
ERROR(0),
EXCEPTION(5),
WARNING(10),
INFO(15),
OUTPUT(20),
LOGGING(25);
private final int value;
CompilerMessageSeverity(int value) {
this.value = value;
}
public int getValue() {
return value;
}
static CompilerMessageSeverity fromValue(int value) {
for (CompilerMessageSeverity severity : CompilerMessageSeverity.values()) {
if (severity.value == value) return severity;
}
return null;
}
ERROR,
EXCEPTION,
WARNING,
INFO,
OUTPUT,
LOGGING;
public static final EnumSet<CompilerMessageSeverity> ERRORS = EnumSet.of(ERROR, EXCEPTION);
public static final EnumSet<CompilerMessageSeverity> VERBOSE = EnumSet.of(OUTPUT, LOGGING);