Skip to content

[Refactor] Replace Debug Statements with Proper Logging Framework #184

@astrogilda

Description

@astrogilda

Is your feature request related to a problem? Please describe.
The codebase contains multiple DEBUG print statements and inconsistent logging approaches, making it difficult to control log output in production environments and debug issues effectively.

Describe the solution you'd like
Implement a centralized logging configuration:

  1. Remove all DEBUG print statements
  2. Set up Python's logging module with appropriate configuration
  3. Create logger instances for each module
  4. Use appropriate log levels (DEBUG, INFO, WARNING, ERROR, CRITICAL)
  5. Add configuration for users to control log levels

Example implementation:

import logging

logger = logging.getLogger(__name__)

# Replace print("DEBUG: ...") with:
logger.debug("Detailed debug information")

Describe alternatives you've considered

  • structlog for structured logging
  • loguru for simplified logging setup
  • Custom logging wrapper

Additional context
Benefits:

  • Production-ready code
  • Better debugging capabilities with configurable log levels
  • Cleaner codebase without print statements
  • Ability to direct logs to files, external services, etc.

This is a quick win with low effort but medium impact on code quality.

Part of codebase quality improvement initiative identified in refactoring analysis.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions