[KLIB Resolver] Deprecate Logger.fatal()
Invocation of Logger.fatal() may cause severe side effects such as throwing an exception or even terminating the current JVM process (check various implementations of this function for details). The code that uses Logger.fatal() sometimes expects a particular kind of side effect. This is totally a design flaw. And it's definitely not a responsibility of Logger to influence the execution flow of the program.
This commit is contained in:
committed by
Space Team
parent
50dd94502b
commit
e92017f64e
@@ -25,6 +25,7 @@ private class CompilerLoggerAdapter(
|
||||
override fun warning(message: String) = messageCollector.report(if (treatWarningsAsErrors) ERROR else STRONG_WARNING, message, null)
|
||||
override fun error(message: String) = messageCollector.report(ERROR, message, null)
|
||||
|
||||
@Deprecated(Logger.FATAL_DEPRECATION_MESSAGE, ReplaceWith(Logger.FATAL_REPLACEMENT))
|
||||
override fun fatal(message: String): Nothing {
|
||||
error(message)
|
||||
(messageCollector as? GroupingMessageCollector)?.flush()
|
||||
|
||||
Reference in New Issue
Block a user