From fc64f4758913239100e86f23f2ecb5dbfb797b80 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Wed, 24 Jan 2024 23:49:16 +0100 Subject: [PATCH] Fix/excessive logging (#848) * Remove log of mangas to update This logged the full manga data objects in the list with information that is not needed (e.g. description of a manga). Once a manga gets updated via the updater, it gets logged, which should be enough * Include manga id in updater log * Use "toString" to log mangas * Change "HttpLoggingInterceptor" level to "BASIC" Was unintentionally merged with d658e07583f3aed2bac0afded7c2b302e8c6411b --- .../kotlin/eu/kanade/tachiyomi/network/NetworkHelper.kt | 2 +- .../kotlin/suwayomi/tachidesk/manga/impl/update/Updater.kt | 6 ++---- .../tachidesk/manga/model/dataclass/MangaDataClass.kt | 6 +++++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/server/src/main/kotlin/eu/kanade/tachiyomi/network/NetworkHelper.kt b/server/src/main/kotlin/eu/kanade/tachiyomi/network/NetworkHelper.kt index 169f990b..4c71774c 100644 --- a/server/src/main/kotlin/eu/kanade/tachiyomi/network/NetworkHelper.kt +++ b/server/src/main/kotlin/eu/kanade/tachiyomi/network/NetworkHelper.kt @@ -97,7 +97,7 @@ class NetworkHelper(context: Context) { } }, ).apply { - level = HttpLoggingInterceptor.Level.HEADERS + level = HttpLoggingInterceptor.Level.BASIC } builder.addNetworkInterceptor(httpLoggingInterceptor) // } diff --git a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/update/Updater.kt b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/update/Updater.kt index aa0eaec3..bae5c3fa 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/update/Updater.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/update/Updater.kt @@ -195,14 +195,14 @@ class Updater : IUpdater { tracker[job.manga.id] = try { - logger.info { "Updating \"${job.manga.title}\" (source: ${job.manga.sourceId})" } + logger.info { "Updating ${job.manga}" } if (serverConfig.updateMangas.value) { Manga.getManga(job.manga.id, true) } Chapter.getChapterList(job.manga.id, true) job.copy(status = JobStatus.COMPLETE) } catch (e: Exception) { - logger.error(e) { "Error while updating ${job.manga.title}" } + logger.error(e) { "Error while updating ${job.manga}" } if (e is CancellationException) throw e job.copy(status = JobStatus.FAILED) } @@ -277,8 +277,6 @@ class Updater : IUpdater { // In case no manga gets updated and no update job was running before, the client would never receive an info about its update request updateStatus(emptyList(), mangasToUpdate.isNotEmpty(), updateStatusCategories, skippedMangas) - logger.debug { "mangasToUpdate $mangasToUpdate" } - if (mangasToUpdate.isEmpty()) { return } diff --git a/server/src/main/kotlin/suwayomi/tachidesk/manga/model/dataclass/MangaDataClass.kt b/server/src/main/kotlin/suwayomi/tachidesk/manga/model/dataclass/MangaDataClass.kt index e748f983..e5af42d7 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/manga/model/dataclass/MangaDataClass.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/manga/model/dataclass/MangaDataClass.kt @@ -43,7 +43,11 @@ data class MangaDataClass( val age: Long? = if (lastFetchedAt == null) 0 else Instant.now().epochSecond.minus(lastFetchedAt), val chaptersAge: Long? = if (chaptersLastFetchedAt == null) null else Instant.now().epochSecond.minus(chaptersLastFetchedAt), val trackers: List? = null, -) +) { + override fun toString(): String { + return "\"$title\" (id= $id) (sourceId= $sourceId)" + } +} data class PagedMangaListDataClass( val mangaList: List,