Skip to content

The agent engineering platform.

community[patch]: Use Custom Logger Instead of Root Logger in get_user_agent Function (#22691)

Enzo Poggio8f019e91d720
diff --git a/libs/community/langchain_community/utils/user_agent.py b/libs/community/langchain_community/utils/user_agent.py
index 140f63b04e..befb8cf9a0 100644
--- a/libs/community/langchain_community/utils/user_agent.py
+++ b/libs/community/langchain_community/utils/user_agent.py
@@ -8,7 +8,7 @@ def get_user_agent() -> str:
"""Get user agent from environment variable."""
env_user_agent = os.environ.get("USER_AGENT")
if not env_user_agent:
- logging.warning(
+ log.warning(
"USER_AGENT environment variable not set, "
"consider setting it to identify your requests."
)