v4.3.0
π§ Major Logging System Refactoring & Import Streamlining
Summary
This PR delivers a comprehensive refactoring of WrenchCL's logging system, replacing the monolithic ccLogBase.py with a modular, SOLID-compliant architecture. Additionally, it streamlines dependency management and improves the developer experience with cleaner imports.
ποΈ Architecture Changes
Logging System Modernization
- Replaced
ccLogBase.py(2,200+ lines) with modularcLogger.pyand supporting services - Introduced clean separation of concerns with dedicated service classes:
ColorService- Manages color presets and terminal compatibilityMessageProcessor- Handles message formatting and markupFormatterFactory- Creates appropriate formatters based on configurationLoggerConfigState- Immutable configuration managementGlobalLoggerManager&HandlerManager- Lifecycle management
Import Simplification
- Standardized logger import:
from WrenchCL import logger(wasfrom WrenchCL.Tools.ccLogBase import logger) - Eliminated wildcard imports in favor of explicit declarations
- Updated all module
__init__.pyfiles for better organization
π Dependency Management Improvements
AWS Optional Dependencies
- Enhanced error messaging when AWS dependencies are missing
- Moved AWS-specific internals to
Connect/_Internal/for better organization - Removed deprecated
gate_imports()function in favor of explicit dependency checks - Pinned
paramiko==3.5.1for stability
Robust Import Testing
- Added comprehensive
test_optional_imports.pywith 300+ lines of tests - Validates graceful degradation when optional dependencies are unavailable
- Ensures core functionality remains accessible regardless of optional packages
π¦ Project Structure Enhancements
Configuration Updates (pyproject.toml)
- Reorganized optional dependencies for clarity (
aws,color,trace,all) - Added maintainer information and comprehensive project URLs
- Included type stubs for better IDE support
- Enhanced development dependency management
Documentation Updates
- Updated all documentation examples to use new import patterns
- Revised
Home.mdwith current best practices
π§ͺ Testing & Quality Improvements
- Comprehensive optional import testing covering real-world usage patterns
- Graceful error handling with helpful user guidance
- Maintained backward compatibility for existing functionality
- Applied SOLID principles throughout the codebase
π« Removed/Deprecated
- β
ccLogBase.py(replaced by modular system) - β
require_module.py(replaced by explicit dependency management) - β
release.shandMakefile(streamlined development process)
Backward Compatibility
- β All existing logger functionality preserved
- β Same API surface for end users
- β Configuration methods unchanged
- β AWS services work identically when dependencies are available
π― Benefits
- Developer Experience: Cleaner imports and better error messages
- Maintainability: Modular architecture following SOLID principles
- Reliability: Comprehensive testing of optional dependency scenarios
- Performance: More efficient formatter and handler management
- Extensibility: Clear separation of concerns enables easier feature additions
This refactoring positions WrenchCL for easier maintenance and future enhancements while providing immediate benefits in code clarity and dependency management.