@@ -63,12 +63,6 @@ def type_cast_value(self, ctx, value):
6363 type = click .Path (exists = False ),
6464 help = "File path where the output will be written" ,
6565)
66- @click .option (
67- "--debug" ,
68- is_flag = True ,
69- help = "Show detailed debug logging output including middleware and HTTP requests" ,
70- default = False ,
71- )
7266@track (when = lambda * _a , ** _kw : os .getenv (ENV_JOB_ID ) is None )
7367def eval (
7468 entrypoint : Optional [str ],
@@ -77,7 +71,6 @@ def eval(
7771 no_report : bool ,
7872 workers : int ,
7973 output_file : Optional [str ],
80- debug : bool ,
8174) -> None :
8275 """Run an evaluation set against the agent.
8376
@@ -87,16 +80,7 @@ def eval(
8780 eval_ids: Optional list of evaluation IDs
8881 workers: Number of parallel workers for running evaluations
8982 no_report: Do not report the evaluation results
90- debug: Show detailed debug logging output
9183 """
92- # Suppress HTTP logs unless in debug mode
93- if not debug :
94- logging .getLogger ("httpx" ).setLevel (logging .WARNING )
95- logging .getLogger ("urllib3.connectionpool" ).setLevel (logging .WARNING )
96- os .environ ["UIPATH_EVAL_DEBUG" ] = "false"
97- else :
98- os .environ ["UIPATH_EVAL_DEBUG" ] = "true"
99-
10084 if not no_report and not os .getenv ("UIPATH_FOLDER_KEY" ):
10185 os .environ ["UIPATH_FOLDER_KEY" ] = asyncio .run (
10286 get_personal_workspace_key_async ()
@@ -123,11 +107,8 @@ def eval(
123107 progress_reporter = StudioWebProgressReporter (LlmOpsHttpExporter ())
124108 asyncio .run (progress_reporter .subscribe_to_eval_runtime_events (event_bus ))
125109
126- # Set up console progress reporter (only when not in debug mode)
110+ # Set up console progress reporter
127111 console_reporter = None
128- if not debug :
129- console_reporter = ConsoleProgressReporter ()
130- asyncio .run (console_reporter .subscribe_to_eval_runtime_events (event_bus ))
131112
132113 def generate_runtime_context (** context_kwargs ) -> UiPathRuntimeContext :
133114 runtime_context = UiPathRuntimeContext .with_defaults (** context_kwargs )
@@ -147,6 +128,20 @@ def generate_runtime_context(**context_kwargs) -> UiPathRuntimeContext:
147128 eval_context .eval_set = eval_set or EvalHelpers .auto_discover_eval_set ()
148129 eval_context .eval_ids = eval_ids
149130
131+ # Set up HTTP logging at DEBUG level but not INFO level
132+ logs_min_level_str = getattr (eval_context , "logs_min_level" , "INFO" )
133+ logs_min_level = getattr (logging , logs_min_level_str .upper (), logging .INFO )
134+ if logs_min_level <= logging .DEBUG :
135+ logging .getLogger ("httpx" ).setLevel (logging .DEBUG )
136+ logging .getLogger ("urllib3.connectionpool" ).setLevel (logging .DEBUG )
137+ else :
138+ logging .getLogger ("httpx" ).setLevel (logging .WARNING )
139+ logging .getLogger ("urllib3.connectionpool" ).setLevel (logging .WARNING )
140+
141+ if logs_min_level <= logging .INFO :
142+ console_reporter = ConsoleProgressReporter ()
143+ asyncio .run (console_reporter .subscribe_to_eval_runtime_events (event_bus ))
144+
150145 try :
151146 runtime_factory = UiPathRuntimeFactory (
152147 UiPathScriptRuntime ,
@@ -165,12 +160,14 @@ async def execute():
165160 await eval_runtime .execute ()
166161 await event_bus .wait_for_all (timeout = 10 )
167162
168- if console_reporter and not debug :
163+ if console_reporter :
169164 console_reporter .display_final_results ()
170165
171166 asyncio .run (execute ())
172167 except Exception as e :
173- console .error (f"❌ Error occurred: { e or 'Execution failed' } " )
168+ console .error (
169+ f"Error occurred: { e or 'Execution failed' } " , include_traceback = True
170+ )
174171
175172
176173if __name__ == "__main__" :
0 commit comments