DebugLogObserver
- class pipecat.observers.loggers.debug_log_observer.FrameEndpoint(*values)[source]
Bases:
Enum
Specifies which endpoint (source or destination) to filter on.
- SOURCE = 1
- DESTINATION = 2
- class pipecat.observers.loggers.debug_log_observer.DebugLogObserver(frame_types=None, exclude_fields=None, **kwargs)[source]
Bases:
BaseObserver
Observer that logs frame activity with detailed content to the console.
Automatically extracts and formats data from any frame type, making it useful for debugging pipeline behavior without needing frame-specific observers.
- Parameters:
frame_types (Tuple[Type[Frame], ...] | Dict[Type[Frame], Tuple[Type, FrameEndpoint] | None] | None) – Optional tuple of frame types to log, or a dict with frame type filters. If None, logs all frame types.
exclude_fields (Set[str] | None) – Optional set of field names to exclude from logging.
Examples
Log all frames from all services:
`python observers = DebugLogObserver() `
Log specific frame types from any source/destination: ```python from pipecat.frames.frames import TranscriptionFrame, InterimTranscriptionFrame observers=[
DebugLogObserver(frame_types=(LLMTextFrame,TranscriptionFrame,)),
],
Log frames with specific source/destination filters: ```python from pipecat.frames.frames import StartInterruptionFrame, UserStartedSpeakingFrame, LLMTextFrame from pipecat.transports.base_output_transport import BaseOutputTransport from pipecat.services.stt_service import STTService
- observers=[
- DebugLogObserver(
- frame_types={
# Only log StartInterruptionFrame when source is BaseOutputTransport StartInterruptionFrame: (BaseOutputTransport, FrameEndpoint.SOURCE), # Only log UserStartedSpeakingFrame when destination is STTService UserStartedSpeakingFrame: (STTService, FrameEndpoint.DESTINATION), # Log LLMTextFrame regardless of source or destination type LLMTextFrame: None,
}
),
],
- async on_push_frame(data)[source]
Process a frame being pushed into the pipeline.
Logs frame details to the console with all relevant fields and values.
- Parameters:
data (FramePushed) – Event data containing the frame, source, destination, direction, and timestamp.