diff options
author | Marcin Aman <marcin.aman@gmail.com> | 2021-06-22 15:17:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-22 15:17:55 +0200 |
commit | 9e15f07aefe6ea1f366466c6721b92e77e3f1b41 (patch) | |
tree | 60ab664edbab02f3c128c1158a9490d06d44f66e /core/test-api | |
parent | 8d6536d3a3d0dcd80a2e6b77b047524e15533f0b (diff) | |
download | dokka-9e15f07aefe6ea1f366466c6721b92e77e3f1b41.tar.gz dokka-9e15f07aefe6ea1f366466c6721b92e77e3f1b41.tar.bz2 dokka-9e15f07aefe6ea1f366466c6721b92e77e3f1b41.zip |
Logging in CLI (#1976)
Diffstat (limited to 'core/test-api')
-rw-r--r-- | core/test-api/api/test-api.api | 23 | ||||
-rw-r--r-- | core/test-api/src/main/kotlin/testApi/context/MockContext.kt | 3 | ||||
-rw-r--r-- | core/test-api/src/main/kotlin/testApi/logger/TestLogger.kt | 31 |
3 files changed, 2 insertions, 55 deletions
diff --git a/core/test-api/api/test-api.api b/core/test-api/api/test-api.api index f5f3a7ea..ef0f69a5 100644 --- a/core/test-api/api/test-api.api +++ b/core/test-api/api/test-api.api @@ -10,29 +10,6 @@ public final class org/jetbrains/dokka/testApi/context/MockContext : org/jetbrai public fun single (Lorg/jetbrains/dokka/plugability/ExtensionPoint;)Ljava/lang/Object; } -public final class org/jetbrains/dokka/testApi/logger/FilteringLogger : org/jetbrains/dokka/utilities/DokkaLogger { - public fun <init> (Lorg/jetbrains/dokka/testApi/logger/FilteringLogger$Level;Lorg/jetbrains/dokka/utilities/DokkaLogger;)V - public fun debug (Ljava/lang/String;)V - public fun error (Ljava/lang/String;)V - public fun getErrorsCount ()I - public fun getWarningsCount ()I - public fun info (Ljava/lang/String;)V - public fun progress (Ljava/lang/String;)V - public fun setErrorsCount (I)V - public fun setWarningsCount (I)V - public fun warn (Ljava/lang/String;)V -} - -public final class org/jetbrains/dokka/testApi/logger/FilteringLogger$Level : java/lang/Enum { - public static final field Debug Lorg/jetbrains/dokka/testApi/logger/FilteringLogger$Level; - public static final field Error Lorg/jetbrains/dokka/testApi/logger/FilteringLogger$Level; - public static final field Info Lorg/jetbrains/dokka/testApi/logger/FilteringLogger$Level; - public static final field Progress Lorg/jetbrains/dokka/testApi/logger/FilteringLogger$Level; - public static final field Warn Lorg/jetbrains/dokka/testApi/logger/FilteringLogger$Level; - public static fun valueOf (Ljava/lang/String;)Lorg/jetbrains/dokka/testApi/logger/FilteringLogger$Level; - public static fun values ()[Lorg/jetbrains/dokka/testApi/logger/FilteringLogger$Level; -} - public final class org/jetbrains/dokka/testApi/logger/TestLogger : org/jetbrains/dokka/utilities/DokkaLogger { public fun <init> (Lorg/jetbrains/dokka/utilities/DokkaLogger;)V public fun debug (Ljava/lang/String;)V diff --git a/core/test-api/src/main/kotlin/testApi/context/MockContext.kt b/core/test-api/src/main/kotlin/testApi/context/MockContext.kt index 97347695..7b17a8ee 100644 --- a/core/test-api/src/main/kotlin/testApi/context/MockContext.kt +++ b/core/test-api/src/main/kotlin/testApi/context/MockContext.kt @@ -5,6 +5,7 @@ import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.DokkaPlugin import org.jetbrains.dokka.plugability.ExtensionPoint import org.jetbrains.dokka.utilities.DokkaConsoleLogger +import org.jetbrains.dokka.utilities.LoggingLevel import kotlin.reflect.KClass import kotlin.reflect.KMutableProperty import kotlin.reflect.full.memberProperties @@ -31,7 +32,7 @@ class MockContext( override fun <T : Any, E : ExtensionPoint<T>> single(point: E): T = get(point).single() - override val logger = DokkaConsoleLogger + override val logger = DokkaConsoleLogger(LoggingLevel.DEBUG) override val configuration: DokkaConfiguration get() = testConfiguration ?: throw IllegalStateException("This mock context doesn't provide configuration") diff --git a/core/test-api/src/main/kotlin/testApi/logger/TestLogger.kt b/core/test-api/src/main/kotlin/testApi/logger/TestLogger.kt index 4f81f098..0bc66a2b 100644 --- a/core/test-api/src/main/kotlin/testApi/logger/TestLogger.kt +++ b/core/test-api/src/main/kotlin/testApi/logger/TestLogger.kt @@ -46,34 +46,3 @@ class TestLogger(private val logger: DokkaLogger) : DokkaLogger { logger.error(message) } } - -class FilteringLogger( - private val minLevel: Level, - private val downstream: DokkaLogger -) : DokkaLogger { - enum class Level { Debug, Info, Progress, Warn, Error } - - override var warningsCount: Int by downstream::warningsCount - - override var errorsCount by downstream::errorsCount - - override fun debug(message: String) { - if (minLevel <= Level.Debug) downstream.debug(message) - } - - override fun info(message: String) { - if (minLevel <= Level.Info) downstream.info(message) - } - - override fun progress(message: String) { - if (minLevel <= Level.Progress) downstream.progress(message) - } - - override fun warn(message: String) { - if (minLevel <= Level.Warn) downstream.warn(message) - } - - override fun error(message: String) { - if (minLevel <= Level.Error) downstream.error(message) - } -} |