Skip to main content

logger

Structured logging utilities.

Functions

add_timestamp

def add_timestamp(logger: Any, method_name: str, event_dict: EventDict) -> EventDict

Add timestamp in [HH:MM:SS.mmm] format to match workspace-api logs.

Args: logger: Logger instance method_name: Log method name (info, debug, etc.) event_dict: Event dictionary

Returns: Event dictionary with timestamp added

setup_logging

def setup_logging() -> None

Configure structured logging for the application.

get_logger

def get_logger(name: str) -> structlog.BoundLogger

Get a structured logger instance.

Args: name: Logger name (typically name)

Returns: Configured structlog logger

log_event

def log_event(logger: structlog.BoundLogger, event_type: str, document_id: str | None = None, kwargs: Any = {}) -> None

Log a structured event with standard fields.

Args: logger: Structlog logger instance event_type: Type of event (e.g., "extraction_started", "chunk_stored") document_id: Document ID if applicable **kwargs: Additional event fields