014 add json logging
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
"""CDEK HTTP client and provider adapter."""
|
||||
|
||||
import asyncio
|
||||
import sys
|
||||
from collections.abc import Awaitable, Callable
|
||||
from typing import Any
|
||||
import logging
|
||||
|
||||
import httpx
|
||||
|
||||
@@ -13,16 +13,7 @@ from app.adapters.delivery_providers.cdek.mapper import map_cdek_response
|
||||
from app.config import AdapterConfig
|
||||
from app.schemas.request import DeliveryRequest
|
||||
from app.schemas.response import DeliveryPrice
|
||||
import logging
|
||||
|
||||
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format="%(asctime)s [%(levelname)s] %(name)s: %(message)s",
|
||||
handlers=[logging.StreamHandler(sys.stdout)] # важно: stdout, не stderr
|
||||
)
|
||||
log = logging.getLogger(__name__)
|
||||
log.info("test")
|
||||
|
||||
|
||||
class CDEKClientError(RuntimeError):
|
||||
|
||||
Reference in New Issue
Block a user