Skip to content

fix: remove logging.basicConfig from __init__.py#155

Open
filhocf wants to merge 1 commit into
cocoindex-io:mainfrom
filhocf:fix/remove-logging-basicconfig
Open

fix: remove logging.basicConfig from __init__.py#155
filhocf wants to merge 1 commit into
cocoindex-io:mainfrom
filhocf:fix/remove-logging-basicconfig

Conversation

@filhocf
Copy link
Copy Markdown

@filhocf filhocf commented May 3, 2026

Summary

Removes the logging.basicConfig(level=logging.WARNING) call from __init__.py.

Problem

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 app that does import cocoindex_code gets its root logger silently reconfigured.

Fix

Remove the logging.basicConfig() call. Libraries should not configure the root logger; that is the application's responsibility.

The daemon.py already has its own logging.basicConfig() call (line 600) which correctly configures logging when the daemon starts, so this removal has no impact on the CLI/daemon behavior.

Closes #124

Calling logging.basicConfig() at import time configures the root logger
for the entire Python process, which interferes with logging setups in
applications that use cocoindex-code as a dependency.

Libraries should not configure the root logger — that is the
application's responsibility.

Closes cocoindex-io#124
@filhocf
Copy link
Copy Markdown
Author

filhocf commented May 3, 2026

@gemini-code-assist review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove logging.basicConfig from package __init__

1 participant