# Логирование

## Инициализация

Для начала импортируйте стандартную библиотеку `logging`: `import logging`\
В коде (обычно в конце `main.py`) должна быть строка `logging.basicConfig(level=level)`\
Подробнее о уровнях ниже

## INFO

Для стандартной работы бота обычно пишут `logging.basicConfig(level=logging.INFO)`\
Значит в логах будет информация (например, о том, что бот запущен) и ошибки при поллинге

## DEBUG

При дебаге бота следует писать `logging.basicConfig(level=logging.DEBUG)`\
В этом случае в логах будет то же что и в INFO, а также информация о сообщениях и коллбэках, которые были хендлены и не были


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dpnspn.gitbook.io/aiomax/logging.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
