aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/utilities
diff options
context:
space:
mode:
authorAndrzej Ratajczak <andrzej.ratajczak98@gmail.com>2020-02-03 15:57:29 +0100
committerAndrzej Ratajczak <andrzej.ratajczak98@gmail.com>2020-02-04 12:10:59 +0100
commit582f5f89557e943169c10a4fc3d58d99528d8e86 (patch)
treeeec837f5f235228df91659663b71fc4f0c281495 /core/src/main/kotlin/utilities
parent3a13b81f2aebc255bec5e48b276c86b2d4ee16a2 (diff)
downloaddokka-582f5f89557e943169c10a4fc3d58d99528d8e86.tar.gz
dokka-582f5f89557e943169c10a4fc3d58d99528d8e86.tar.bz2
dokka-582f5f89557e943169c10a4fc3d58d99528d8e86.zip
Adds summary reporting for all logging runners
Diffstat (limited to 'core/src/main/kotlin/utilities')
-rw-r--r--core/src/main/kotlin/utilities/DokkaLogging.kt23
1 files changed, 13 insertions, 10 deletions
diff --git a/core/src/main/kotlin/utilities/DokkaLogging.kt b/core/src/main/kotlin/utilities/DokkaLogging.kt
index 9fe15d59..1c05c95d 100644
--- a/core/src/main/kotlin/utilities/DokkaLogging.kt
+++ b/core/src/main/kotlin/utilities/DokkaLogging.kt
@@ -1,16 +1,19 @@
package org.jetbrains.dokka.utilities
interface DokkaLogger {
+ var warningsCount: Int
+ var errorsCount: Int
fun debug(message: String)
fun info(message: String)
fun progress(message: String)
fun warn(message: String)
fun error(message: String)
+ fun report()
}
object DokkaConsoleLogger : DokkaLogger {
- var warningCount: Int = 0
- var errorCount: Int = 0
+ override var warningsCount: Int = 0
+ override var errorsCount: Int = 0
override fun debug(message: String)= println(message)
@@ -18,16 +21,16 @@ object DokkaConsoleLogger : DokkaLogger {
override fun info(message: String) = println(message)
- override fun warn(message: String) = println("WARN: $message").also { warningCount++ }
+ override fun warn(message: String) = println("WARN: $message").also { warningsCount++ }
- override fun error(message: String) = println("ERROR: $message").also { errorCount++ }
+ override fun error(message: String) = println("ERROR: $message").also { errorsCount++ }
- fun report() {
- if (warningCount > 0 || errorCount > 0) {
- println("generation completed with $warningCount warning" +
- (if(warningCount == 1) "" else "s") +
- " and $errorCount error" +
- if(errorCount == 1) "" else "s"
+ override fun report() {
+ if (warningsCount > 0 || errorsCount > 0) {
+ println("Generation completed with warningsCount warning" +
+ (if(warningsCount == 1) "" else "s") +
+ " and errorsCount error" +
+ if(errorsCount == 1) "" else "s"
)
} else {
println("generation completed successfully")