From 347896dbacc4c8d65b04bf9135a50bfa7ee36dbf Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 23 Nov 2023 12:56:00 +0600 Subject: [PATCH] start fill new docs for logging in bot --- docs/tgbotapi/logs.md | 15 +++++++++++++++ mkdocs.yml | 1 + 2 files changed, 16 insertions(+) create mode 100644 docs/tgbotapi/logs.md diff --git a/docs/tgbotapi/logs.md b/docs/tgbotapi/logs.md new file mode 100644 index 0000000..7c41e56 --- /dev/null +++ b/docs/tgbotapi/logs.md @@ -0,0 +1,15 @@ +# Logging + +In this library we are using [KSLog](/kslog) for logging of events in telegram bots. There are several ways to set it +up and configure. + +* Globally, you may change [DefaultKTgBotAPIKSLog]() logger __BEFORE__ creating of your bots +* Granular, you may configure and pass `logger` variable to the `KtorRequestsExecutor` + +Besides, you always may pass your logger to the bot via `KtorRequestsExecutorBuilder`: + +```kotlin +val bot = telegramBot(YOUR_TOKEN) { + logger = KSLog("SomeLogger") +} +``` diff --git a/mkdocs.yml b/mkdocs.yml index dd2b763..4a2ca41 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -14,6 +14,7 @@ nav: - 'tgbotapi/index.md' - KDocs: 'https://tgbotapi.inmo.dev' - 'tgbotapi/faq.md' + - 'tgbotapi/logs.md' - Introduction: - 'tgbotapi/introduction/before-any-bot-project.md' - 'tgbotapi/introduction/including-in-your-project.md'