Skip to content

Conversation

@bsbodden
Copy link
Collaborator

@bsbodden bsbodden commented Mar 25, 2025

Fix: Prevent RedisVL from overriding existing logging configurations

Issue

When importing any RedisVL component, the library currently overrides existing user-defined logging configurations silently. This happens because coloredlogs.install() is called during module import in redisvl/utils/log.py, which affects the root logger without the user's knowledge or consent.

Changes

  • Modified the get_logger function in log.py to respect existing logging configurations
  • Added reconfigure=False to prevent modifying existing loggers
  • Added isatty=True to only use colors in supported terminals
  • Added a check to only configure loggers that don't already have handlers

Testing

Replicates the before RedisVL is loaded scenario by using an external (to the test) py file that's run on it's own process

Fixes #293

@bsbodden bsbodden changed the base branch from main to 0.5.0 March 25, 2025 16:05
@bsbodden bsbodden requested review from abrookins and rbs333 and removed request for abrookins March 25, 2025 16:36
Copy link
Collaborator

@rbs333 rbs333 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bsbodden bsbodden merged commit 494e5e2 into 0.5.0 Mar 25, 2025
36 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.

RedisVL breaks existing logging configurations

3 participants