Skip to content

Commit 122892f

Browse files
committed
Issue oshai#480 - apply formatting
1 parent 3ed804c commit 122892f

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

src/commonMain/kotlin/io/github/oshai/kotlinlogging/KotlinLogging.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ import io.github.oshai.kotlinlogging.internal.KLoggerNameResolver
55
import kotlin.js.JsName
66

77
/**
8-
* Since this library is intended to be multiplatform,
9-
* there are several ways to create a logger depending on your programming language.
8+
* Since this library is intended to be multiplatform, there are several ways to create a logger
9+
* depending on your programming language.
1010
*
11-
* Please note, that creating a logger by reference involves reflection or, in some cases,
12-
* stack trace analysis. Therefore, if performance is a priority, avoid creating loggers
13-
* in frequently executed code sections.
11+
* Please note, that creating a logger by reference involves reflection or, in some cases, stack
12+
* trace analysis. Therefore, if performance is a priority, avoid creating loggers in frequently
13+
* executed code sections.
1414
*
15-
* A logger created by reference will take the name of the class of the reference.
16-
* If the reference is a "companion object," the name of its enclosing class will be used instead.
15+
* A logger created by reference will take the name of the class of the reference. If the reference
16+
* is a "companion object," the name of its enclosing class will be used instead.
1717
*
1818
* ```kotlin
1919
* val topLevelNamedLogger = KotlinLogging.logger("TopLevelNamedLogger")

src/jsMain/kotlin/io/github/oshai/kotlinlogging/internal/KLoggerNameResolver.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,12 @@ internal actual object KLoggerNameResolver {
3434
// new MyClass() <- enclosing class
3535
if (
3636
callerLine + 2 >= stackTrace.size ||
37-
!stackTrace[callerLine + 1].contains("$className$COMPANION_GET_INSTANCE_SUFFIX")
37+
!stackTrace[callerLine + 1].contains("$className$COMPANION_GET_INSTANCE_SUFFIX")
3838
) {
3939
return className
4040
}
41-
val enclosingFound = CLASS_LEVEL_INIT_PROPERTIES_REGEX.find(stackTrace[callerLine + 2]) ?: return className
41+
val enclosingFound =
42+
CLASS_LEVEL_INIT_PROPERTIES_REGEX.find(stackTrace[callerLine + 2]) ?: return className
4243
return enclosingFound.groupValues[1]
4344
}
4445
}

src/wasmJsMain/kotlin/io/github/oshai/kotlinlogging/internal/KLoggerNameResolver.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,12 @@ internal actual object KLoggerNameResolver {
3434
// MyClass.<init>() <- enclosing class
3535
if (
3636
callerLine + 2 >= stackTrace.size ||
37-
!stackTrace[callerLine + 1].contains("$className$COMPANION_GET_INSTANCE_SUFFIX")
37+
!stackTrace[callerLine + 1].contains("$className$COMPANION_GET_INSTANCE_SUFFIX")
3838
) {
3939
return className
4040
}
41-
val enclosingFound = CLASS_LEVEL_INIT_PROPERTIES_REGEX.find(stackTrace[callerLine + 2]) ?: return className
41+
val enclosingFound =
42+
CLASS_LEVEL_INIT_PROPERTIES_REGEX.find(stackTrace[callerLine + 2]) ?: return className
4243
return enclosingFound.groupValues[1]
4344
}
4445
}

0 commit comments

Comments
 (0)