aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/utilities/DokkaLogging.kt
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat.beresnev@jetbrains.com>2023-08-31 20:16:01 +0200
committerGitHub <noreply@github.com>2023-08-31 20:16:01 +0200
commit02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33 (patch)
tree66f6d6f089a93b863bf1144666491eca6729ad05 /core/src/main/kotlin/utilities/DokkaLogging.kt
parent6a181a7a2b03ec263788d137610e86937a57d434 (diff)
downloaddokka-02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33.tar.gz
dokka-02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33.tar.bz2
dokka-02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33.zip
Enable explicit API mode (#3139)
Diffstat (limited to 'core/src/main/kotlin/utilities/DokkaLogging.kt')
-rw-r--r--core/src/main/kotlin/utilities/DokkaLogging.kt31
1 files changed, 17 insertions, 14 deletions
diff --git a/core/src/main/kotlin/utilities/DokkaLogging.kt b/core/src/main/kotlin/utilities/DokkaLogging.kt
index 52492930..7855c9c1 100644
--- a/core/src/main/kotlin/utilities/DokkaLogging.kt
+++ b/core/src/main/kotlin/utilities/DokkaLogging.kt
@@ -6,17 +6,18 @@ package org.jetbrains.dokka.utilities
import java.util.concurrent.atomic.AtomicInteger
-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)
+public interface DokkaLogger {
+ public var warningsCount: Int
+ public var errorsCount: Int
+
+ public fun debug(message: String)
+ public fun info(message: String)
+ public fun progress(message: String)
+ public fun warn(message: String)
+ public fun error(message: String)
}
-fun DokkaLogger.report() {
+public fun DokkaLogger.report() {
if (warningsCount > 0 || errorsCount > 0) {
info(
"Generation completed with $warningsCount warning" +
@@ -29,20 +30,22 @@ fun DokkaLogger.report() {
}
}
-enum class LoggingLevel(val index: Int) {
+public enum class LoggingLevel(
+ public val index: Int
+) {
DEBUG(0), PROGRESS(1), INFO(2), WARN(3), ERROR(4);
}
/**
* Used to decouple the transport layer from logger and make it convenient for testing
*/
-fun interface MessageEmitter : (String) -> Unit {
- companion object {
- val consoleEmitter: MessageEmitter = MessageEmitter { message -> println(message) }
+public fun interface MessageEmitter : (String) -> Unit {
+ public companion object {
+ public val consoleEmitter: MessageEmitter = MessageEmitter { message -> println(message) }
}
}
-class DokkaConsoleLogger(
+public class DokkaConsoleLogger(
private val minLevel: LoggingLevel = LoggingLevel.PROGRESS,
private val emitter: MessageEmitter = MessageEmitter.consoleEmitter
) : DokkaLogger {