LoggerSetup-module/README.md
2025-03-24 00:51:37 +03:00

23 lines
761 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# setup_logger
Setup loguru module
!!! Запуск происходит до инициализации ядра
!!! Обязательно должен быть `from core import Core` (`Core.DIR`, `Core.ver_str`)
luguru настроен под формат:
```python
fmt = "<green>{elapsed} -- {time:YYYY-MM-DD HH:mm:ss.SSS}</green> | <level>{level:<8}</level> | {extra[module]:^12} | {extra[prefix]:<12} | {message}"
```
т.у. в `extra` нужно передавать `module` и `prefix`:
```python
log = logger.bind(module="setup_logger", prefix="setup_logger")
log.info("Hello, World!")
```
Добавление в проект:
```bash
git submodule add ssh://git@git.anidev.ru:222/AnidevSoft/LoggerSetup-module.git src/modules/LoggerSetup
```