aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/utilities/DokkaLogging.kt
diff options
context:
space:
mode:
authorAndrzej Ratajczak <andrzej.ratajczak98@gmail.com>2020-01-31 10:49:25 +0100
committerAndrzej Ratajczak <andrzej.ratajczak98@gmail.com>2020-02-04 12:10:59 +0100
commit3a13b81f2aebc255bec5e48b276c86b2d4ee16a2 (patch)
tree8aa55f2b725e247f6661386ffca4220c6a2c6125 /core/src/main/kotlin/utilities/DokkaLogging.kt
parentec8e0aa7dbdc74c381dfe9c012711a895ccac6d4 (diff)
downloaddokka-3a13b81f2aebc255bec5e48b276c86b2d4ee16a2.tar.gz
dokka-3a13b81f2aebc255bec5e48b276c86b2d4ee16a2.tar.bz2
dokka-3a13b81f2aebc255bec5e48b276c86b2d4ee16a2.zip
Handles errors and fixes minor bugs
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")
}