aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/utilities/DokkaLogging.kt
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main/kotlin/utilities/DokkaLogging.kt')
-rw-r--r--core/src/main/kotlin/utilities/DokkaLogging.kt11
1 files changed, 8 insertions, 3 deletions
diff --git a/core/src/main/kotlin/utilities/DokkaLogging.kt b/core/src/main/kotlin/utilities/DokkaLogging.kt
index 6eb7867b..9fe15d59 100644
--- a/core/src/main/kotlin/utilities/DokkaLogging.kt
+++ b/core/src/main/kotlin/utilities/DokkaLogging.kt
@@ -10,6 +10,7 @@ interface DokkaLogger {
object DokkaConsoleLogger : DokkaLogger {
var warningCount: Int = 0
+ var errorCount: Int = 0
override fun debug(message: String)= println(message)
@@ -19,11 +20,15 @@ object DokkaConsoleLogger : DokkaLogger {
override fun warn(message: String) = println("WARN: $message").also { warningCount++ }
- override fun error(message: String) = println("ERROR: $message")
+ override fun error(message: String) = println("ERROR: $message").also { errorCount++ }
fun report() {
- if (warningCount > 0) {
- println("generation completed with $warningCount warnings")
+ if (warningCount > 0 || errorCount > 0) {
+ println("generation completed with $warningCount warning" +
+ (if(warningCount == 1) "" else "s") +
+ " and $errorCount error" +
+ if(errorCount == 1) "" else "s"
+ )
} else {
println("generation completed successfully")
}