diff options
Diffstat (limited to 'core/src/main/kotlin/Utilities/DokkaLogging.kt')
-rw-r--r-- | core/src/main/kotlin/Utilities/DokkaLogging.kt | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/core/src/main/kotlin/Utilities/DokkaLogging.kt b/core/src/main/kotlin/Utilities/DokkaLogging.kt new file mode 100644 index 00000000..1ef52837 --- /dev/null +++ b/core/src/main/kotlin/Utilities/DokkaLogging.kt @@ -0,0 +1,27 @@ +package org.jetbrains.dokka + +interface DokkaLogger { + fun info(message: String) + fun warn(message: String) + fun error(message: String) +} + +object DokkaConsoleLogger : DokkaLogger { + var warningCount: Int = 0 + + override fun info(message: String) = println(message) + override fun warn(message: String) { + println("WARN: $message") + warningCount++ + } + + override fun error(message: String) = println("ERROR: $message") + + fun report() { + if (warningCount > 0) { + println("generation completed with $warningCount warnings") + } else { + println("generation completed successfully") + } + } +} |