From a63d1530a4a06ff694f93a5fd1286db8abf3ea4d Mon Sep 17 00:00:00 2001 From: Filipi Fuchter Date: Wed, 23 Jul 2025 14:43:53 -0300 Subject: [PATCH] Added set_log_level to DailyTransport. --- CHANGELOG.md | 3 +++ examples/foundational/04a-transports-daily.py | 3 ++- src/pipecat/transports/services/daily.py | 15 +++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cccecd034..afcbf0315 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added `LocalSmartTurnAnalyzerV2`, which supports local on-device inference with the new `smart-turn-v2` turn detection model. +- Added `set_log_level` to `DailyTransport`, allowing setting the logging level + for Daily's internal logging system. + ### Changed - Updated the `deepgram` optional dependency to 4.7.0, which downgrades the diff --git a/examples/foundational/04a-transports-daily.py b/examples/foundational/04a-transports-daily.py index e330b53a9..f5ac4586a 100644 --- a/examples/foundational/04a-transports-daily.py +++ b/examples/foundational/04a-transports-daily.py @@ -20,7 +20,7 @@ from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext from pipecat.services.cartesia.tts import CartesiaTTSService from pipecat.services.openai.llm import OpenAILLMService -from pipecat.transports.services.daily import DailyParams, DailyTransport +from pipecat.transports.services.daily import DailyLogLevel, DailyParams, DailyTransport load_dotenv(override=True) @@ -43,6 +43,7 @@ async def main(): vad_analyzer=SileroVADAnalyzer(), ), ) + transport.set_log_level(DailyLogLevel.Info) tts = CartesiaTTSService( api_key=os.getenv("CARTESIA_API_KEY"), diff --git a/src/pipecat/transports/services/daily.py b/src/pipecat/transports/services/daily.py index fdbca6643..ce1f671a6 100644 --- a/src/pipecat/transports/services/daily.py +++ b/src/pipecat/transports/services/daily.py @@ -62,6 +62,9 @@ try: VirtualCameraDevice, VirtualSpeakerDevice, ) + from daily import ( + LogLevel as DailyLogLevel, + ) except ModuleNotFoundError as e: logger.error(f"Exception: {e}") logger.error( @@ -1924,6 +1927,18 @@ class DailyTransport(BaseTransport): """ return self._client.participant_id + def set_log_level(self, level: DailyLogLevel): + """Set the logging level for Daily's internal logging system. + + Args: + level: The log level to set. Should be a member of the DailyLogLevel enum, + such as DailyLogLevel.Info, DailyLogLevel.Debug, etc. + + Example: + transport.set_log_level(DailyLogLevel.Info) + """ + Daily.set_log_level(level) + async def send_image(self, frame: OutputImageRawFrame | SpriteFrame): """Send an image frame to the Daily call.