v5.0.0
Modularize WrenchCL Logger Architecture
Breaking Changes
- Moved
cLoggerfrom/WrenchCL/cLogger.py→/WrenchCL/_Internal/cLogger.py - Import path updated:
from ._Internal import cLoggerin__init__.py
New Architecture
Decomposed monolithic cLogger (756 lines) into focused API modules:
BaseLogger: Core logging interface with standard methods (info,debug,error, etc.)ManagedLoggers: Handler lifecycle management (add, adopt, sync, silence)StreamManager: System-level stream control and exception interceptionInternalAPI: Implementation details isolated from public interface
New Features
ProcessingTracker: Postgres-backed job tracking with TTL cleanup- Enhanced Stream Control:
- Exception hook installation (
sys.excepthook,threading.excepthook) - Configurable stdout/stderr suppression
- Exception hook installation (
- Handler Ownership System: Distinguish between WrenchCL-owned vs user-attached handlers
Improvements
- Thread Safety: Proper scoping for handler updates (
ownedvsall) - Formatter Management: Better separation between instance and global formatters
- Error Handling: Consistent internal logging (
_internal.log_internal) - Code Quality: Removed redundant docstring parameters, improved DRY compliance
Migration Impact
- Core API remains backward compatible
- Internal method calls updated throughout codebase
- New capabilities available via
logger.managed.*andlogger.streams.*