def _format_value(self, value):
        """Format a value for logging.

        Args:
            value: The value to format.

        Returns:
            str: A string representation of the value suitable for logging.
        """
        if value is None:
            return "None"
        elif isinstance(value, str):
            return f"{value!r}"
        elif isinstance(value, (list, tuple)):
            if len(value) == 0:
                return "[]"
            if isinstance(value[0], dict) and len(value) > 3:
                # For message lists, just show count
                return f"{len(value)} items"
            return str(value)
        elif isinstance(value, (bytes, bytearray)):
            return f"{len(value)} bytes"
        elif hasattr(value, "get_messages_for_logging") and callable(
            getattr(value, "get_messages_for_logging")
        ):
            # Special case for OpenAI context
            return f"{value.__class__.__name__} with messages: {value.get_messages_for_logging()}"
        else:
            return str(value)
Format a value for logging.

        Args:
            value: The value to format.

        Returns:
            str: A string representation of the value suitable for logging.
        
src/pipecat/observers/loggers/debug_log_observer.py