Skip to content

Commit

Permalink
Revert changing log level in FileUtils.kt (#2801)
Browse files Browse the repository at this point in the history
Follow up on #2787
  • Loading branch information
paul-dingemans authored Sep 18, 2024
1 parent d115ef4 commit 97a9b44
Showing 1 changed file with 1 addition and 21 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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<Logger>)
?.underlyingLogger
private val LOGGER = KotlinLogging.logger {}.initKtLintKLogger()

private val ROOT_DIR_PATH: Path = Paths.get("").toAbsolutePath()

Expand Down

0 comments on commit 97a9b44

Please sign in to comment.