Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

Refactor logging configuration and adjust log levels in memory service

Magnus Müllerc40efbc890d1
diff --git a/browser_use/agent/memory/service.py b/browser_use/agent/memory/service.py
index e1913a123..082ec1202 100644
--- a/browser_use/agent/memory/service.py
+++ b/browser_use/agent/memory/service.py
@@ -89,7 +89,7 @@ class Memory:
Args:
current_step: The current step number of the agent
"""
- logger.info(f'Creating procedural memory at step {current_step}')
+ logger.debug(f'Creating procedural memory at step {current_step}')
# Get all messages
all_messages = self.message_manager.state.history.messages
@@ -108,7 +108,7 @@ class Memory:
# Need at least 2 messages to create a meaningful summary
if len(messages_to_process) <= 1:
- logger.info('Not enough non-memory messages to summarize')
+ logger.debug('Not enough non-memory messages to summarize')
return
# Create a procedural memory
memory_content = self._create([m.message for m in messages_to_process], current_step)
diff --git a/browser_use/logging_config.py b/browser_use/logging_config.py
index bdbea35c1..1109cf7e4 100644
--- a/browser_use/logging_config.py
+++ b/browser_use/logging_config.py
@@ -110,8 +110,8 @@ def setup_logging():
logger = logging.getLogger('browser_use')
# logger.info('BrowserUse logging setup complete with level %s', log_type)
- # Silence third-party loggers
- for logger in [
+ # Silence or adjust third-party loggers
+ third_party_loggers = [
'WDM',
'httpx',
'selenium',
@@ -126,7 +126,12 @@ def setup_logging():
'PIL.PngImagePlugin',
'trafilatura.htmlprocessing',
'trafilatura',
- ]:
- third_party = logging.getLogger(logger)
+ 'mem0',
+ 'mem0.vector_stores.faiss',
+ 'mem0.vector_stores',
+ 'mem0.memory',
+ ]
+ for logger_name in third_party_loggers:
+ third_party = logging.getLogger(logger_name)
third_party.setLevel(logging.ERROR)
third_party.propagate = False