Skip to content

Commit fc64f47

Browse files
authored
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 d658e07
1 parent 562b940 commit fc64f47

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

server/src/main/kotlin/eu/kanade/tachiyomi/network/NetworkHelper.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class NetworkHelper(context: Context) {
9797
}
9898
},
9999
).apply {
100-
level = HttpLoggingInterceptor.Level.HEADERS
100+
level = HttpLoggingInterceptor.Level.BASIC
101101
}
102102
builder.addNetworkInterceptor(httpLoggingInterceptor)
103103
// }

server/src/main/kotlin/suwayomi/tachidesk/manga/impl/update/Updater.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,14 @@ class Updater : IUpdater {
195195

196196
tracker[job.manga.id] =
197197
try {
198-
logger.info { "Updating \"${job.manga.title}\" (source: ${job.manga.sourceId})" }
198+
logger.info { "Updating ${job.manga}" }
199199
if (serverConfig.updateMangas.value) {
200200
Manga.getManga(job.manga.id, true)
201201
}
202202
Chapter.getChapterList(job.manga.id, true)
203203
job.copy(status = JobStatus.COMPLETE)
204204
} catch (e: Exception) {
205-
logger.error(e) { "Error while updating ${job.manga.title}" }
205+
logger.error(e) { "Error while updating ${job.manga}" }
206206
if (e is CancellationException) throw e
207207
job.copy(status = JobStatus.FAILED)
208208
}
@@ -277,8 +277,6 @@ class Updater : IUpdater {
277277
// In case no manga gets updated and no update job was running before, the client would never receive an info about its update request
278278
updateStatus(emptyList(), mangasToUpdate.isNotEmpty(), updateStatusCategories, skippedMangas)
279279

280-
logger.debug { "mangasToUpdate $mangasToUpdate" }
281-
282280
if (mangasToUpdate.isEmpty()) {
283281
return
284282
}

server/src/main/kotlin/suwayomi/tachidesk/manga/model/dataclass/MangaDataClass.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ data class MangaDataClass(
4343
val age: Long? = if (lastFetchedAt == null) 0 else Instant.now().epochSecond.minus(lastFetchedAt),
4444
val chaptersAge: Long? = if (chaptersLastFetchedAt == null) null else Instant.now().epochSecond.minus(chaptersLastFetchedAt),
4545
val trackers: List<MangaTrackerDataClass>? = null,
46-
)
46+
) {
47+
override fun toString(): String {
48+
return "\"$title\" (id= $id) (sourceId= $sourceId)"
49+
}
50+
}
4751

4852
data class PagedMangaListDataClass(
4953
val mangaList: List<MangaDataClass>,

0 commit comments

Comments
 (0)