<reponame>dashmug/us-covid-stats<filename>backend/us_covid_stats/infrastructure/logging.py
import json
import logging
from functools import wraps
from typing import Any, Callable

logger = logging.getLogger()
logger.setLevel(logging.INFO)


def log_event(func: Callable[[Any, Any], Any]) -> Callable[[Any, Any], Any]:
    @wraps(func)
    def wrapper(event: Any, context: Any) -> Any:
        logger.info(json.dumps(event))

        return func(event, context)

    return wrapper

import json
import logging
from functools import wraps
from typing import Any, Callable

logger = logging.getLogger()
logger.setLevel(logging.INFO)


def log_event(func: Callable[[Any, Any], Any]) -> Callable[[Any, Any], Any]:
    @wraps(func)
    def wrapper(event: Any, context: Any) -> Any:
        logger.info(json.dumps(event))

        return func(event, context)

    return wrapper