diff --git a/langchain/agents/agent.py b/langchain/agents/agent.py index c85ec7f6e9..fb4621abf3 100644 --- a/langchain/agents/agent.py +++ b/langchain/agents/agent.py @@ -30,7 +30,7 @@ from langchain.schema import ( from langchain.tools.base import BaseTool from langchain.utilities.asyncio import asyncio_timeout -logger = logging.getLogger() +logger = logging.getLogger(__name__) class BaseSingleActionAgent(BaseModel): diff --git a/langchain/chat_models/azure_openai.py b/langchain/chat_models/azure_openai.py index 1327665af8..ed79be35c0 100644 --- a/langchain/chat_models/azure_openai.py +++ b/langchain/chat_models/azure_openai.py @@ -9,7 +9,7 @@ from pydantic import root_validator from langchain.chat_models.openai import ChatOpenAI from langchain.utils import get_from_dict_or_env -logger = logging.getLogger(__file__) +logger = logging.getLogger(__name__) class AzureChatOpenAI(ChatOpenAI): diff --git a/langchain/chat_models/openai.py b/langchain/chat_models/openai.py index 644ed261dc..4bbf1ee816 100644 --- a/langchain/chat_models/openai.py +++ b/langchain/chat_models/openai.py @@ -26,7 +26,7 @@ from langchain.schema import ( ) from langchain.utils import get_from_dict_or_env -logger = logging.getLogger(__file__) +logger = logging.getLogger(__name__) def _create_retry_decorator(llm: ChatOpenAI) -> Callable[[Any], Any]: diff --git a/langchain/document_loaders/diffbot.py b/langchain/document_loaders/diffbot.py index 149c0c5a35..c740ee3201 100644 --- a/langchain/document_loaders/diffbot.py +++ b/langchain/document_loaders/diffbot.py @@ -7,7 +7,7 @@ import requests from langchain.docstore.document import Document from langchain.document_loaders.base import BaseLoader -logger = logging.getLogger(__file__) +logger = logging.getLogger(__name__) class DiffbotLoader(BaseLoader): diff --git a/langchain/document_loaders/directory.py b/langchain/document_loaders/directory.py index 370875d7ca..ec121d6038 100644 --- a/langchain/document_loaders/directory.py +++ b/langchain/document_loaders/directory.py @@ -12,7 +12,7 @@ from langchain.document_loaders.unstructured import UnstructuredFileLoader FILE_LOADER_TYPE = Union[ Type[UnstructuredFileLoader], Type[TextLoader], Type[BSHTMLLoader] ] -logger = logging.getLogger(__file__) +logger = logging.getLogger(__name__) def _is_visible(p: Path) -> bool: diff --git a/langchain/document_loaders/html_bs.py b/langchain/document_loaders/html_bs.py index 42f27b9b88..c90e32d709 100644 --- a/langchain/document_loaders/html_bs.py +++ b/langchain/document_loaders/html_bs.py @@ -6,7 +6,7 @@ from typing import Dict, List, Union from langchain.docstore.document import Document from langchain.document_loaders.base import BaseLoader -logger = logging.getLogger(__file__) +logger = logging.getLogger(__name__) class BSHTMLLoader(BaseLoader): diff --git a/langchain/document_loaders/url.py b/langchain/document_loaders/url.py index 9ab01e8f2a..d8b25c37f7 100644 --- a/langchain/document_loaders/url.py +++ b/langchain/document_loaders/url.py @@ -5,7 +5,7 @@ from typing import Any, List from langchain.docstore.document import Document from langchain.document_loaders.base import BaseLoader -logger = logging.getLogger(__file__) +logger = logging.getLogger(__name__) class UnstructuredURLLoader(BaseLoader): diff --git a/langchain/document_loaders/url_playwright.py b/langchain/document_loaders/url_playwright.py index 15a5dbd77e..508283c316 100644 --- a/langchain/document_loaders/url_playwright.py +++ b/langchain/document_loaders/url_playwright.py @@ -6,7 +6,7 @@ from typing import List, Optional from langchain.docstore.document import Document from langchain.document_loaders.base import BaseLoader -logger = logging.getLogger(__file__) +logger = logging.getLogger(__name__) class PlaywrightURLLoader(BaseLoader): diff --git a/langchain/document_loaders/url_selenium.py b/langchain/document_loaders/url_selenium.py index dd0c7152f7..d061d1aebe 100644 --- a/langchain/document_loaders/url_selenium.py +++ b/langchain/document_loaders/url_selenium.py @@ -9,7 +9,7 @@ if TYPE_CHECKING: from langchain.docstore.document import Document from langchain.document_loaders.base import BaseLoader -logger = logging.getLogger(__file__) +logger = logging.getLogger(__name__) class SeleniumURLLoader(BaseLoader): diff --git a/langchain/document_loaders/web_base.py b/langchain/document_loaders/web_base.py index d51f458b93..45bd70365a 100644 --- a/langchain/document_loaders/web_base.py +++ b/langchain/document_loaders/web_base.py @@ -9,7 +9,7 @@ import requests from langchain.docstore.document import Document from langchain.document_loaders.base import BaseLoader -logger = logging.getLogger(__file__) +logger = logging.getLogger(__name__) default_header_template = { "User-Agent": "", diff --git a/langchain/llms/huggingface_pipeline.py b/langchain/llms/huggingface_pipeline.py index 1f3e40c225..be8787dac9 100644 --- a/langchain/llms/huggingface_pipeline.py +++ b/langchain/llms/huggingface_pipeline.py @@ -12,7 +12,7 @@ DEFAULT_MODEL_ID = "gpt2" DEFAULT_TASK = "text-generation" VALID_TASKS = ("text2text-generation", "text-generation") -logger = logging.getLogger() +logger = logging.getLogger(__name__) class HuggingFacePipeline(LLM): diff --git a/langchain/llms/self_hosted.py b/langchain/llms/self_hosted.py index 68397da239..df529d80f4 100644 --- a/langchain/llms/self_hosted.py +++ b/langchain/llms/self_hosted.py @@ -9,7 +9,7 @@ from pydantic import Extra from langchain.llms.base import LLM from langchain.llms.utils import enforce_stop_tokens -logger = logging.getLogger() +logger = logging.getLogger(__name__) def _generate_text( diff --git a/langchain/llms/self_hosted_hugging_face.py b/langchain/llms/self_hosted_hugging_face.py index 8138ffbbef..dd62348cca 100644 --- a/langchain/llms/self_hosted_hugging_face.py +++ b/langchain/llms/self_hosted_hugging_face.py @@ -12,7 +12,7 @@ DEFAULT_MODEL_ID = "gpt2" DEFAULT_TASK = "text-generation" VALID_TASKS = ("text2text-generation", "text-generation") -logger = logging.getLogger() +logger = logging.getLogger(__name__) def _generate_text( diff --git a/langchain/prompts/loading.py b/langchain/prompts/loading.py index c849297924..f545cc8595 100644 --- a/langchain/prompts/loading.py +++ b/langchain/prompts/loading.py @@ -14,7 +14,7 @@ from langchain.prompts.prompt import PromptTemplate from langchain.utilities.loading import try_load_from_hub URL_BASE = "https://raw.githubusercontent.com/hwchase17/langchain-hub/master/prompts/" -logger = logging.getLogger(__file__) +logger = logging.getLogger(__name__) def load_prompt_from_config(config: dict) -> BasePromptTemplate: diff --git a/langchain/text_splitter.py b/langchain/text_splitter.py index 37834ce69e..f35d3c1eb9 100644 --- a/langchain/text_splitter.py +++ b/langchain/text_splitter.py @@ -18,7 +18,7 @@ from typing import ( from langchain.docstore.document import Document -logger = logging.getLogger() +logger = logging.getLogger(__name__) class TextSplitter(ABC): diff --git a/langchain/vectorstores/atlas.py b/langchain/vectorstores/atlas.py index af7f555737..6166a10137 100644 --- a/langchain/vectorstores/atlas.py +++ b/langchain/vectorstores/atlas.py @@ -11,7 +11,7 @@ from langchain.docstore.document import Document from langchain.embeddings.base import Embeddings from langchain.vectorstores.base import VectorStore -logger = logging.getLogger() +logger = logging.getLogger(__name__) class AtlasDB(VectorStore): diff --git a/langchain/vectorstores/chroma.py b/langchain/vectorstores/chroma.py index 64d34efb25..b7399bf6e1 100644 --- a/langchain/vectorstores/chroma.py +++ b/langchain/vectorstores/chroma.py @@ -16,7 +16,7 @@ if TYPE_CHECKING: import chromadb import chromadb.config -logger = logging.getLogger() +logger = logging.getLogger(__name__) def _results_to_docs(results: Any) -> List[Document]: diff --git a/langchain/vectorstores/deeplake.py b/langchain/vectorstores/deeplake.py index 71d51cf41b..a59c5a0488 100644 --- a/langchain/vectorstores/deeplake.py +++ b/langchain/vectorstores/deeplake.py @@ -13,7 +13,7 @@ from langchain.embeddings.base import Embeddings from langchain.vectorstores.base import VectorStore from langchain.vectorstores.utils import maximal_marginal_relevance -logger = logging.getLogger() +logger = logging.getLogger(__name__) distance_metric_map = { "l2": lambda a, b: np.linalg.norm(a - b, axis=1, ord=2), diff --git a/langchain/vectorstores/redis.py b/langchain/vectorstores/redis.py index 30b926518b..618b11ee54 100644 --- a/langchain/vectorstores/redis.py +++ b/langchain/vectorstores/redis.py @@ -16,7 +16,7 @@ from langchain.schema import BaseRetriever from langchain.utils import get_from_dict_or_env from langchain.vectorstores.base import VectorStore -logger = logging.getLogger() +logger = logging.getLogger(__name__) # required modules