Skip to content

Log level not reconfigurable at runtime #58

@thanhbn

Description

@thanhbn

Bug Report: --log-level DEBUG not working after logging initialization

Bug Description

When running CLI commands with --log-level DEBUG, the debug logs are not displayed if logging has already been initialized. The reconfigure() method only updates the file destination but ignores the log level parameter.

To Reproduce

  1. Run any CLI command first (logging gets initialized):

    qdrant-loader config --workspace .
  2. Run another command with --log-level DEBUG:

    qdrant-loader ingest --workspace . --log-level DEBUG
  3. Observe that DEBUG level logs are not shown

Expected Behavior

  • Debug logs should be displayed when --log-level DEBUG is specified
  • Log level should be reconfigurable at runtime

Expected output:

DEBUG: Starting ingestion...
DEBUG: Loading config from...
INFO: Ingestion completed

Actual Behavior

  • Debug logs are not shown
  • Log level remains at the initial value (INFO)

Actual output:

INFO: Ingestion completed

(no debug logs shown)

Environment

  • OS: Linux (WSL2)
  • Python version: 3.12
  • QDrant Loader version: 0.7.3

Root Cause Analysis

In packages/qdrant-loader-core/src/qdrant_loader_core/logging.py:360, the reconfigure() method only accepts file parameter and ignores log level:

# Current implementation
def reconfigure(file: Optional[str] = None):
    # Only handles file, ignores level
    ...

Proposed Solution

Update reconfigure() to accept and apply level parameter, then update all CLI commands to pass level=log_level.

Affected Files

  • packages/qdrant-loader-core/src/qdrant_loader_core/logging.py
  • packages/qdrant-loader/src/qdrant_loader/cli/commands/config.py
  • packages/qdrant-loader/src/qdrant_loader/cli/commands/config_cmd.py
  • packages/qdrant-loader/src/qdrant_loader/cli/commands/ingest_cmd.py
  • packages/qdrant-loader/src/qdrant_loader/cli/commands/init_cmd.py

Labels

bug, cli, logging, bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions