Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Removed root logger configuration as this should be handled by application code

Azam Dinc8ccf5fd8977
diff --git a/src/python/txtai/__init__.py b/src/python/txtai/__init__.py
index 76258cc7..4f5e942e 100644
--- a/src/python/txtai/__init__.py
+++ b/src/python/txtai/__init__.py
@@ -4,8 +4,13 @@ Version string
import logging
-# Set default logging format
-logging.basicConfig(format="%(asctime)s [%(levelname)s] %(funcName)s: %(message)s")
+# Configure logging for the txtai package
+# We should use logging.basicConfig() here as it modifies the root logger. But
+# log handlers/formatters should only be tweaked in the application code. Ref:
+# - https://stackoverflow.com/a/27017068/19357935
+# - https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library
+logger = logging.getLogger(__name__)
+logger.addHandler(logging.NullHandler())
# Current version tag
__version__ = "5.2.0"