# fnb v0.12.0 - Structured Logging System

**Release Date**: 2025-08-28
**Type**: Minor Release
**Migration**: No breaking changes

## Release Highlights

This minor release introduces a comprehensive structured logging system powered by loguru, transforming fnb from a simple CLI tool into a production-ready application with enterprise-grade logging capabilities.

### 📊 **Structured Logging System Implementation**

Complete replacement of print-based output with professional logging:

- **Print Statement Migration** - All 47 print statements across 6 modules converted to structured logger calls
- **CLI Integration** - Every command now supports `--log-level`, `--verbose`, and `--quiet` options
- **Output Separation** - Clean separation between user-facing output (stdout) and debugging logs (stderr/files)
- **Platform Support** - Cross-platform log file management with intelligent defaults

### 🔧 **Intelligent Log Management**

Advanced log file handling with automatic maintenance:

- **Platform-Specific Locations** - macOS: `~/Library/Logs/fnb/fnb.log`, Linux: `~/.local/share/fnb/fnb.log`, Windows: `%APPDATA%\qumasan\fnb\Logs\fnb.log`
- **Automatic Rotation** - Files rotate at 10MB with 7-day retention and gzip compression
- **Environment Detection** - Automatically disables file logging in test environments
- **User Control** - Set `FNB_DISABLE_FILE_LOGGING=1` to disable file logging

### 🚀 **Enhanced CLI Experience**

Consistent logging options across all fnb commands:

- **Verbosity Control** - `--verbose` for debug output, `--quiet` for minimal output
- **Granular Levels** - `--log-level` supports DEBUG, INFO, WARNING, ERROR
- **Startup Feedback** - Log file location displayed on command startup
- **Backward Compatibility** - All existing commands work identically

## Technical Changes

### New Architecture Components
- **`logger.py` Module** - Centralized LoggerManager class for logging configuration
- **Environment Integration** - Smart detection of test vs production environments
- **Memory Optimization** - Conditional operations based on logging configuration

### Quality Assurance Improvements
- **Test Coverage Maintained** - 87% overall coverage with 90% coverage for new logging module
- **Integration Testing** - All 23 integration tests pass with new logging system
- **CI/CD Compatibility** - Full pipeline compatibility with structured logging

## Installation & Usage

No changes to installation - logging features are automatically available:

```bash
# Installation remains the same
pip install fnb

# All commands now support logging options
fnb status --verbose          # Debug-level output
fnb fetch logs --quiet        # Warnings and errors only
fnb sync data --log-level INFO # Standard operational output
```

## Implementation Metrics

- **Development Time**: 3 days of focused implementation
- **Code Changes**: 19 commits covering implementation, testing, and documentation
- **Modules Updated**: 6 core modules with logging integration
- **Test Success**: 118/124 unit tests (95.2%), 23/23 integration tests (100%)

## Community Impact

- **Better Troubleshooting** - Detailed logs help users diagnose issues effectively
- **Script-Friendly** - `--quiet` mode perfect for automated workflows and scripts
- **Developer Experience** - Enhanced debugging with comprehensive logging throughout the application
- **Professional Quality** - Structured approach to information output improves reliability

## Migration Guide

No migration required - fnb v0.12.0 maintains full backward compatibility:

- All existing commands work exactly as before
- Configuration files remain unchanged
- Existing workflows continue without modification
- New logging options are available but optional

---

## Resources

- **Documentation**: https://fnb.readthedocs.io/
- **Release Notes**: https://fnb.readthedocs.io/en/latest/releases/
- **Installation Guide**: https://fnb.readthedocs.io/en/latest/usage/installation/
- **Configuration Guide**: https://fnb.readthedocs.io/en/latest/usage/configuration/
