1
0
mirror of https://git.sr.ht/~tsileo/microblog.pub synced 2025-06-05 21:59:23 +02:00

Tweak logging

This commit is contained in:
Thomas Sileo
2022-08-20 09:11:48 +02:00
parent 538af64955
commit 691ad500c6
4 changed files with 11 additions and 2 deletions

View File

@ -5,6 +5,7 @@ from typing import TYPE_CHECKING
from typing import Any
import httpx
from loguru import logger
from markdown import markdown
from app import config
@ -135,6 +136,7 @@ async def fetch(
params: dict[str, Any] | None = None,
disable_httpsig: bool = False,
) -> RawObject:
logger.info(f"Fetching {url} ({params=})")
check_url(url)
async with httpx.AsyncClient() as client:
@ -342,6 +344,7 @@ def remove_context(raw_object: RawObject) -> RawObject:
async def post(url: str, payload: dict[str, Any]) -> httpx.Response:
logger.info(f"Posting {url} ({payload=})")
check_url(url)
async with httpx.AsyncClient() as client: