Skip to content

Instantly share code, notes, and snippets.

@glucazeau
glucazeau / cf_logging.py
Last active April 10, 2023 11:05
Using Loguru with Google Cloud Logging in a Cloud Function
import json
from loguru import logger
# From: https://cloud.google.com/run/docs/logging#writing_structured_logs
class CloudLoggingHandler:
def __init__(self, request):
project = "" # Add your project name here