From 88734c1642920e163ec9fd434603bd599d72b080 Mon Sep 17 00:00:00 2001 From: Travis Wyatt Date: Wed, 12 Jun 2024 10:39:13 -0700 Subject: [PATCH] Use Khronicle for logging (#300) --- compile/build.gradle.kts | 6 +++--- compile/src/main/kotlin/ExerciseProcessor.kt | 2 +- compile/src/main/kotlin/ExerciseProcessorProvider.kt | 4 ++-- compile/src/main/kotlin/Logging.kt | 10 +++++----- gradle/libs.versions.toml | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/compile/build.gradle.kts b/compile/build.gradle.kts index f6018ff..eda4ff7 100644 --- a/compile/build.gradle.kts +++ b/compile/build.gradle.kts @@ -16,11 +16,11 @@ kotlin { } dependencies { - implementation(project(":annotations")) - implementation(project(":stubs")) + implementation(libs.khronicle) implementation(libs.kotlinpoet) implementation(libs.ksp.api) - implementation(libs.tuulbox.logging) + implementation(project(":annotations")) + implementation(project(":stubs")) testImplementation(kotlin("test-junit")) testImplementation(libs.assertj) testImplementation(libs.ksp.testing) diff --git a/compile/src/main/kotlin/ExerciseProcessor.kt b/compile/src/main/kotlin/ExerciseProcessor.kt index 1fa63cc..bed7b4d 100644 --- a/compile/src/main/kotlin/ExerciseProcessor.kt +++ b/compile/src/main/kotlin/ExerciseProcessor.kt @@ -10,7 +10,7 @@ import com.juul.exercise.compile.read.asReceiver import com.juul.exercise.compile.read.findDependencies import com.juul.exercise.compile.read.findParameters import com.juul.exercise.compile.write.ExerciseWriter -import com.juul.tuulbox.logging.Log +import com.juul.khronicle.Log internal class ExerciseProcessor( private val codeGenerator: CodeGenerator, diff --git a/compile/src/main/kotlin/ExerciseProcessorProvider.kt b/compile/src/main/kotlin/ExerciseProcessorProvider.kt index d4afcbe..583ab2f 100644 --- a/compile/src/main/kotlin/ExerciseProcessorProvider.kt +++ b/compile/src/main/kotlin/ExerciseProcessorProvider.kt @@ -3,11 +3,11 @@ package com.juul.exercise.compile import com.google.devtools.ksp.processing.SymbolProcessor import com.google.devtools.ksp.processing.SymbolProcessorEnvironment import com.google.devtools.ksp.processing.SymbolProcessorProvider -import com.juul.tuulbox.logging.Log +import com.juul.khronicle.Log public class ExerciseProcessorProvider : SymbolProcessorProvider { override fun create(environment: SymbolProcessorEnvironment): SymbolProcessor { - Log.dispatcher.install(KspTuulboxLogger(environment.logger)) + Log.dispatcher.install(KspKhronicleLogger(environment.logger)) return ExerciseProcessor(environment.codeGenerator) } } diff --git a/compile/src/main/kotlin/Logging.kt b/compile/src/main/kotlin/Logging.kt index aa70531..2c66ded 100644 --- a/compile/src/main/kotlin/Logging.kt +++ b/compile/src/main/kotlin/Logging.kt @@ -2,13 +2,13 @@ package com.juul.exercise.compile import com.google.devtools.ksp.processing.KSPLogger import com.google.devtools.ksp.symbol.KSNode -import com.juul.tuulbox.logging.Key -import com.juul.tuulbox.logging.Logger -import com.juul.tuulbox.logging.ReadMetadata +import com.juul.khronicle.Key +import com.juul.khronicle.Logger +import com.juul.khronicle.ReadMetadata internal object Node : Key -internal class KspTuulboxLogger( +internal class KspKhronicleLogger( private val backend: KSPLogger, ) : Logger { @@ -47,5 +47,5 @@ internal class KspTuulboxLogger( override fun hashCode(): Int = backend.hashCode() - override fun equals(other: Any?): Boolean = other is KspTuulboxLogger && backend == other.backend + override fun equals(other: Any?): Boolean = other is KspKhronicleLogger && backend == other.backend } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7a78c0b..25364bc 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,12 +7,12 @@ kotlin = "2.0.0" [libraries] assertj = { module = "org.assertj:assertj-core", version = "3.26.0" } -kotlinpoet = { module = "com.squareup:kotlinpoet", version = "1.17.0" } +khronicle = { module = "com.juul.khronicle:khronicle-core", version = "0.3.0" } kotlin-parcelize-runtime = { module = "org.jetbrains.kotlin:kotlin-parcelize-runtime", version.ref = "kotlin" } +kotlinpoet = { module = "com.squareup:kotlinpoet", version = "1.17.0" } ksp-api = { module = "com.google.devtools.ksp:symbol-processing-api", version = "2.0.0-1.0.22" } ksp-testing = { module = "com.github.tschuchortdev:kotlin-compile-testing-ksp", version = "1.6.0" } robolectric = { module = "org.robolectric:robolectric", version = "4.12.2" } -tuulbox-logging = { module = "com.juul.tuulbox:logging", version = "7.2.0" } [plugins] android-application = { id = "com.android.application", version.ref = "agp" }