From 02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33 Mon Sep 17 00:00:00 2001 From: Ignat Beresnev Date: Thu, 31 Aug 2023 20:16:01 +0200 Subject: Enable explicit API mode (#3139) --- core/src/main/kotlin/utilities/DokkaLogging.kt | 31 ++++++++++++++------------ 1 file changed, 17 insertions(+), 14 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 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 { -- cgit