Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
Clean logs
Magnus Müller5c4adb29033c
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.pyindex b70bd8051..188b09ba1 100644--- a/browser_use/agent/service.py+++ b/browser_use/agent/service.py@@ -1527,7 +1527,6 @@ class Agent(Generic[Context, AgentStructuredOutput]):await on_step_end(self)if self.history.is_done():- self.logger.debug(f'🎯 Task completed after {step + 1} steps!')await self.log_completion()if self.register_done_callback:@@ -1558,14 +1557,12 @@ class Agent(Generic[Context, AgentStructuredOutput]):self.logger.info(f'❌ {agent_run_error}')- self.logger.debug('📊 Collecting usage summary...')self.history.usage = await self.token_cost_service.get_usage_summary()# set the model output schema and call it on the flyif self.history._output_model_schema is None and self.output_model_schema is not None:self.history._output_model_schema = self.output_model_schema- self.logger.debug('🏁 Agent.run() completed successfully')return self.historyexcept KeyboardInterrupt:@@ -2051,8 +2048,6 @@ class Agent(Generic[Context, AgentStructuredOutput]):self.logger.debug(f'⚡ Remaining asyncio tasks ({len(other_tasks)}):')for task in other_tasks[:10]: # Limit to first 10 to avoid spamself.logger.debug(f' - {task.get_name()}: {task}')- else:- self.logger.debug('⚡ No remaining asyncio tasks')except Exception as e:self.logger.error(f'Error during cleanup: {e}')diff --git a/browser_use/tokens/service.py b/browser_use/tokens/service.pyindex b4277d2e4..f0a90ffbf 100644--- a/browser_use/tokens/service.py+++ b/browser_use/tokens/service.py@@ -494,9 +494,6 @@ class TokenCost:f'⬅️ {C_YELLOW}{prompt_tokens_fmt}{prompt_cost_part}{C_RESET} | ➡️ {C_GREEN}{completion_tokens_fmt}{completion_cost_part}{C_RESET}')- # Log per-model breakdown- cost_logger.debug(f'📊 {C_BOLD}Per-Model Usage Breakdown{C_RESET}:')-for model, stats in summary.by_model.items():# Format tokensmodel_total_fmt = self._format_tokens(stats.total_tokens)