Switch database logger to SLF4J

This commit is contained in:
Syer10
2023-03-31 22:19:13 -04:00
parent 4c30d8ab05
commit eb197ebcee
11 changed files with 42 additions and 25 deletions

View File

@@ -10,7 +10,7 @@ package suwayomi.tachidesk.graphql.dataLoaders
import com.expediagroup.graphql.dataloader.KotlinDataLoader
import org.dataloader.DataLoader
import org.dataloader.DataLoaderFactory
import org.jetbrains.exposed.sql.StdOutSqlLogger
import org.jetbrains.exposed.sql.Slf4jSqlDebugLogger
import org.jetbrains.exposed.sql.addLogger
import org.jetbrains.exposed.sql.select
import org.jetbrains.exposed.sql.transactions.transaction
@@ -23,7 +23,7 @@ class ChapterDataLoader : KotlinDataLoader<Int, ChapterType> {
override fun getDataLoader(): DataLoader<Int, ChapterType> = DataLoaderFactory.newDataLoader<Int, ChapterType> { ids ->
future {
transaction {
addLogger(StdOutSqlLogger)
addLogger(Slf4jSqlDebugLogger)
ChapterTable.select { ChapterTable.id inList ids }
.map { ChapterType(it) }
}
@@ -36,7 +36,7 @@ class ChaptersForMangaDataLoader : KotlinDataLoader<Int, List<ChapterType>> {
override fun getDataLoader(): DataLoader<Int, List<ChapterType>> = DataLoaderFactory.newDataLoader<Int, List<ChapterType>> { ids ->
future {
transaction {
addLogger(StdOutSqlLogger)
addLogger(Slf4jSqlDebugLogger)
val chaptersByMangaId = ChapterTable.select { ChapterTable.manga inList ids }
.map { ChapterType(it) }
.groupBy { it.mangaId }