Skip to content

fix: remove logging.basicConfig from __init__.py (#155)#194

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

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

Conversation

@cschanhniem

Copy link
Copy Markdown

Closes #155.

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. Any application that does import cocoindex_code gets its root logger silently reconfigured, which interferes with logging setups in consuming projects.

Fix: Remove the call entirely. The daemon already handles its own logging setup in daemon.main() with proper file + stream handlers. Libraries should not configure the root logger — that's the application's responsibility.

… 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.
@Haleshot

Copy link
Copy Markdown

Duplicate of #155.

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.

2 participants