aboutsummaryrefslogtreecommitdiff
path: root/core/test-api/src/main
diff options
context:
space:
mode:
authorMarcin Aman <marcin.aman@gmail.com>2021-06-22 15:17:55 +0200
committerGitHub <noreply@github.com>2021-06-22 15:17:55 +0200
commit9e15f07aefe6ea1f366466c6721b92e77e3f1b41 (patch)
tree60ab664edbab02f3c128c1158a9490d06d44f66e /core/test-api/src/main
parent8d6536d3a3d0dcd80a2e6b77b047524e15533f0b (diff)
downloaddokka-9e15f07aefe6ea1f366466c6721b92e77e3f1b41.tar.gz
dokka-9e15f07aefe6ea1f366466c6721b92e77e3f1b41.tar.bz2
dokka-9e15f07aefe6ea1f366466c6721b92e77e3f1b41.zip
Logging in CLI (#1976)
Diffstat (limited to 'core/test-api/src/main')
-rw-r--r--core/test-api/src/main/kotlin/testApi/context/MockContext.kt3
-rw-r--r--core/test-api/src/main/kotlin/testApi/logger/TestLogger.kt31
2 files changed, 2 insertions, 32 deletions
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)
- }
-}