From 45ba059d307f9a960781deb33e2e60b22506965c Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Fri, 19 Jun 2026 04:48:24 +0000 Subject: [PATCH] fix: remove logging.basicConfig from __init__.py to avoid root logger pollution Calling logging.basicConfig() at import time configures the root logger for the entire Python process. This interferes with logging setups in applications that use cocoindex-code as a dependency -- any consumer that does 'import cocoindex_code' gets its root logger silently reconfigured. The daemon already handles its own logging setup in daemon.main() with file + stream handlers. Removing the module-level basicConfig is safe and follows the standard library pattern: libraries use getLogger(__name__), applications configure the root logger. --- src/cocoindex_code/__init__.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/cocoindex_code/__init__.py b/src/cocoindex_code/__init__.py index f424967..88f8852 100644 --- a/src/cocoindex_code/__init__.py +++ b/src/cocoindex_code/__init__.py @@ -2,7 +2,6 @@ from __future__ import annotations -import logging import os from typing import TYPE_CHECKING, Any @@ -11,8 +10,6 @@ # init time). See cocoindex-io/cocoindex#1992. os.environ.setdefault("COCOINDEX_APPLICATION_FOR_TRACKING", "cocoindex-code") -logging.basicConfig(level=logging.WARNING) - from ._version import __version__ # noqa: E402 if TYPE_CHECKING: