mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 00:17:11 -07:00
Better logging.
This commit is contained in:
parent
465b763aba
commit
fec0b6c713
1 changed files with 7 additions and 4 deletions
|
@ -101,13 +101,16 @@ class KotlinCompiler @Inject constructor(
|
|||
throw UnsupportedOperationException("not implemented")
|
||||
}
|
||||
|
||||
fun CompilerMessageLocation.dump(s: String) = "$path:$line:$column $s"
|
||||
|
||||
override fun report(severity: CompilerMessageSeverity,
|
||||
message: String, location: CompilerMessageLocation) {
|
||||
if (severity.isError) {
|
||||
System.err.println(location.path + ":" + location.line + ":" + location.column
|
||||
+ " " + message)
|
||||
} else {
|
||||
println(severity.name + ": $message")
|
||||
System.err.println(location.dump(message))
|
||||
} else if (severity == CompilerMessageSeverity.WARNING) {
|
||||
warn(location.dump(message))
|
||||
} else if (severity == CompilerMessageSeverity.INFO && KobaltLogger.LOG_LEVEL >= 2) {
|
||||
log(2, location.dump(message))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue