From 378c8857e5e61e2660079d7bef7e7a2b6dcd8b9b Mon Sep 17 00:00:00 2001 From: Karanraj Date: Tue, 16 Sep 2025 23:59:11 +0530 Subject: [PATCH] - Added TRACE-level logging for all events when LOG_LEVEL=TRACE. - Kept workflow-specific logging/handling for InputRequiredEvent intact. - Clarified comments to avoid confusion between generic TRACE logging and event-specific workflow handling. --- src/uipath_llamaindex/_cli/_runtime/_runtime.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/uipath_llamaindex/_cli/_runtime/_runtime.py b/src/uipath_llamaindex/_cli/_runtime/_runtime.py index 9d2a0ad..78595ee 100644 --- a/src/uipath_llamaindex/_cli/_runtime/_runtime.py +++ b/src/uipath_llamaindex/_cli/_runtime/_runtime.py @@ -1,3 +1,4 @@ +from datetime import datetime import json import logging import os @@ -76,7 +77,11 @@ async def execute(self) -> Optional[UiPathRuntimeResult]: response_applied = False async for event in handler.stream_events(): - # log the received event on trace level + # LOG all llama events in runtime if LOG_LEVEL env var is set to TRACE + if os.getenv("LOG_LEVEL", "").upper() == "TRACE": + logger.debug(f"[TRACE] Event received at {datetime.now()}: {type(event).__name__} -> {event!r}") + + # Workflow-specific handling for InputRequiredEvent if isinstance(event, InputRequiredEvent): # for api trigger hitl scenarios only pass the str input for processing hitl_processor = HitlProcessor(value=event.prefix)