From 97a9b4424d2e2acba9dba9583b40ba62bd94ef46 Mon Sep 17 00:00:00 2001 From: Paul Dingemans Date: Wed, 18 Sep 2024 14:34:42 +0200 Subject: [PATCH] Revert changing log level in FileUtils.kt (#2801) Follow up on #2787 --- .../ktlint/cli/internal/FileUtils.kt | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/ktlint-cli/src/main/kotlin/com/pinterest/ktlint/cli/internal/FileUtils.kt b/ktlint-cli/src/main/kotlin/com/pinterest/ktlint/cli/internal/FileUtils.kt index 9edfa6b7e8..5cef6b12aa 100644 --- a/ktlint-cli/src/main/kotlin/com/pinterest/ktlint/cli/internal/FileUtils.kt +++ b/ktlint-cli/src/main/kotlin/com/pinterest/ktlint/cli/internal/FileUtils.kt @@ -1,11 +1,6 @@ package com.pinterest.ktlint.cli.internal -import ch.qos.logback.classic.Level -import ch.qos.logback.classic.Logger import com.pinterest.ktlint.logger.api.initKtLintKLogger -import com.pinterest.ktlint.logger.api.setDefaultLoggerModifier -import io.github.oshai.kotlinlogging.DelegatingKLogger -import io.github.oshai.kotlinlogging.KLogger import io.github.oshai.kotlinlogging.KotlinLogging import org.jetbrains.kotlin.util.prefixIfNot import java.io.File @@ -25,22 +20,7 @@ import kotlin.io.path.pathString import kotlin.io.path.relativeToOrSelf import kotlin.system.measureTimeMillis -private val LOGGER = - KotlinLogging - .logger {} - .setDefaultLoggerModifier { it.level = Level.TRACE } - .initKtLintKLogger() - -private var KLogger.level: Level? - get() = underlyingLogger()?.level - set(value) { - underlyingLogger()?.level = value - } - -private fun KLogger.underlyingLogger(): Logger? = - @Suppress("UNCHECKED_CAST") - (this as? DelegatingKLogger) - ?.underlyingLogger +private val LOGGER = KotlinLogging.logger {}.initKtLintKLogger() private val ROOT_DIR_PATH: Path = Paths.get("").toAbsolutePath()