Skip to content

Commit cec0017

Browse files
committed
ktlint
1 parent 2ab88ac commit cec0017

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLogRecordBuilder.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ public class CrtLogRecordBuilder(
1515
) : LogRecordBuilder {
1616
private var cause: Throwable? = null
1717
private var msg: (() -> String)? = null
18-
private val kvp by lazy { mutableMapOf<String, Any>() }
1918

2019
override fun setCause(ex: Throwable) {
2120
cause = ex
@@ -29,9 +28,8 @@ public class CrtLogRecordBuilder(
2928
msg = message
3029
}
3130

32-
override fun setKeyValuePair(key: String, value: Any) {
33-
kvp[key] = value
34-
}
31+
// CRT logger does not support setting key-value pairs
32+
override fun setKeyValuePair(key: String, value: Any) { }
3533

3634
override fun emit() {
3735
val message = requireNotNull(msg) { "no message provided to LogRecordBuilder" }

runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLogger.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ import aws.smithy.kotlin.runtime.telemetry.logging.MessageSupplier
1414
import aws.sdk.kotlin.crt.Config as CrtConfig
1515
import aws.sdk.kotlin.crt.LogLevel as CrtLogLevel
1616

17-
public class CrtLogger(public val name: String, public val config: CrtConfig) : Logger, WithCrt() {
17+
public class CrtLogger(public val name: String, public val config: CrtConfig) :
18+
WithCrt(),
19+
Logger {
1820
override fun trace(t: Throwable?, msg: MessageSupplier) {
1921
log(CrtLogLevel.Trace, msg())
2022
}

runtime/observability/logging-crt/native/src/aws/smithy/kotlin/runtime/telemetry/logging/crt/CrtLoggerProvider.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55

66
package aws.smithy.kotlin.runtime.telemetry.logging.crt
77

8-
import aws.sdk.kotlin.crt.Config as CrtConfig
98
import aws.smithy.kotlin.runtime.telemetry.logging.*
9+
import aws.sdk.kotlin.crt.Config as CrtConfig
1010

1111
public class CrtLoggerProvider : LoggerProvider {
1212
override fun getOrCreateLogger(name: String): Logger = CrtLogger(name, CrtConfig())
1313
public fun getOrCreateLogger(name: String, config: CrtConfig): Logger = CrtLogger(name, config)
1414
}
15-

0 commit comments

Comments
 (0)