From 3a13b81f2aebc255bec5e48b276c86b2d4ee16a2 Mon Sep 17 00:00:00 2001 From: Andrzej Ratajczak Date: Fri, 31 Jan 2020 10:49:25 +0100 Subject: Handles errors and fixes minor bugs --- core/src/main/kotlin/utilities/DokkaLogging.kt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'core/src/main/kotlin/utilities/DokkaLogging.kt') 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") } -- cgit