Skip to content

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

Merged
georgeh0 merged 3 commits into
cocoindex-io:mainfrom
filhocf:fix/remove-logging-basicconfig
Jun 19, 2026
Merged

fix: remove logging.basicConfig from __init__.py#155
georgeh0 merged 3 commits into
cocoindex-io:mainfrom
filhocf:fix/remove-logging-basicconfig

Conversation

@filhocf

@filhocf filhocf commented May 3, 2026

Copy link
Copy Markdown
Contributor

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

filhocf commented May 3, 2026

Copy link
Copy Markdown
Contributor Author

@gemini-code-assist review

@badmonster0 badmonster0 requested a review from georgeh0 June 16, 2026 06:04
@badmonster0

Copy link
Copy Markdown
Member

hey @filhocf sorry it have been a while, @georgeh0 could help take a look, ty!

@georgeh0 georgeh0 merged commit a18a0ee into cocoindex-io:main Jun 19, 2026
4 checks passed
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__

3 participants