Log warning (#5192)

Changes debug log to warning log when LC Tracer fails to instantiate
This commit is contained in:
Zander Chase 2023-05-24 14:05:13 -07:00 committed by GitHub
parent b7fcb35a39
commit 66113c2a62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -888,7 +888,12 @@ def _configure(
handler.ensure_session()
callback_manager.add_handler(handler, True)
except Exception as e:
logger.debug("Unable to load requested LangChainTracer", e)
logger.warning(
"Unable to load requested LangChainTracer."
" To disable this warning,"
" unset the LANGCHAIN_TRACING_V2 environment variables.",
e,
)
if open_ai is not None and not any(
isinstance(handler, OpenAICallbackHandler)
for handler in callback_manager.handlers