From ffc0f5abb7aeed5c66b363ab6801c0f6782941d5 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 23 Nov 2023 20:00:52 +0600 Subject: [PATCH] add improvements in logging functionality --- .../inmo/tgbotapi/bot/ktor/KtorRequestsExecutorFactories.kt | 6 +++--- .../tgbotapi/bot/ktor/base/DefaultKtorRequestsExecutor.kt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/ktor/KtorRequestsExecutorFactories.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/ktor/KtorRequestsExecutorFactories.kt index a25b7b1572..2ab970a366 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/ktor/KtorRequestsExecutorFactories.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/ktor/KtorRequestsExecutorFactories.kt @@ -11,9 +11,9 @@ import io.ktor.client.HttpClient import kotlinx.serialization.json.Json @RiskFeature -fun createTelegramBotDefaultKtorCallRequestsFactories() = listOf( - SimpleRequestCallFactory(), - MultipartRequestCallFactory(), +fun createTelegramBotDefaultKtorCallRequestsFactories(logger: KSLog? = null) = listOf( + SimpleRequestCallFactory(logger), + MultipartRequestCallFactory(logger), DownloadFileRequestCallFactory, DownloadFileChannelRequestCallFactory ) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/ktor/base/DefaultKtorRequestsExecutor.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/ktor/base/DefaultKtorRequestsExecutor.kt index 50fa0d3bd3..fd7a0bf237 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/ktor/base/DefaultKtorRequestsExecutor.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/ktor/base/DefaultKtorRequestsExecutor.kt @@ -38,7 +38,7 @@ class DefaultKtorRequestsExecutor internal constructor( private val callsFactories: List = callsFactories.run { if (!excludeDefaultFactories) { logger.v { "Installing default factories" } - this + createTelegramBotDefaultKtorCallRequestsFactories() + this + createTelegramBotDefaultKtorCallRequestsFactories(logger) } else { logger.v { "Default factories will not be installed" } this