Skip to content

Instantly share code, notes, and snippets.

@angely-dev
angely-dev / loggedroute.py
Last active April 27, 2024 12:02
FastAPI log every request and response
from fastapi import Request, Response, HTTPException
from fastapi.exceptions import RequestValidationError
from fastapi.routing import APIRoute
from http.client import responses
from json import JSONDecodeError
from starlette.exceptions import HTTPException as StarletteHTTPException
from traceback import format_exc
from typing import Callable
import logging
@angely-dev
angely-dev / README.md
Last active April 20, 2024 17:14
Update napalm-huawei-vrp README

Quick start

(…)

Diff mechanism

The driver supports two diff modes:

  • non-contextual diff (default behavior)
  • contextual diff (as proposed in PR #23)