Files
pyfragment/app/core/logging.py
T
bohd4nx 7f3c3ea1c3 refactor: update API key source in .env.example and enhance README with badges and feature descriptions
feat: improve logging levels for HTTP clients and add detailed logging in premium and stars purchase methods
chore: remove unused transaction utility and adjust wallet processing logic
test: add end-to-end integration test for buying Stars
2026-03-05 06:26:49 +02:00

23 lines
732 B
Python

import logging
def setup_logging() -> None:
formatter = logging.Formatter(
fmt="[%(asctime)s] - %(levelname)s: %(message)s", datefmt="%d.%m.%y %H:%M:%S"
)
console_handler = logging.StreamHandler()
console_handler.setLevel(logging.INFO)
console_handler.setFormatter(formatter)
file_handler = logging.FileHandler("FragmentAPI.log", mode="w", encoding="utf-8")
file_handler.setLevel(logging.DEBUG)
file_handler.setFormatter(formatter)
logging.basicConfig(level=logging.DEBUG, handlers=[console_handler, file_handler], force=True)
logging.getLogger("httpx").setLevel(logging.WARNING)
logging.getLogger("httpcore").setLevel(logging.WARNING)
logger = logging.getLogger(__name__)