omni_logger 2.0.0
omni_logger: ^2.0.0 copied to clipboard
Omni Logger is a production-ready logging package for Flutter with auto-configuration, file rotation, isolate support, and build mode optimization.
2.0.0 - 2026-05-28 #
Changed #
- Replaced fragile environment variable path lookups with
path_providerfor cross-platform reliability AppLog.setup()andOmniLoggerClient.setup()are now asynchronous and must be awaited inmain.dart
Fixed #
- Mobile startup path crashes resolved by using
getApplicationSupportDirectory() - Wrapped directory resolution in fail-safe try/catch blocks with
systemTempfallback for all non-web platforms
Breaking Change #
AppLog.setup()andOmniLoggerClient.setup()must now be awaited
1.0.5 - 2026-05-11 #
Fixed #
- Expanded
descriptioninpubspec.yamlto meet pub.dev requirements (50-180 characters)
1.0.4 - 2026-05-11 #
Fixed #
- Actually applied
device_info_plusversion range>=10.1.0 <14.0.0to resolve compatibility withamplify_analytics_pinpointandflutter_secure_storage_windows
1.0.3 - 2026-05-11 #
Fixed #
- Widened
device_info_plusversion range to>=10.1.0 <14.0.0to resolve compatibility conflicts withamplify_analytics_pinpointandflutter_secure_storage_windows
1.0.2 - 2026-05-11 #
Fixed #
- Downgraded
device_info_plusto^10.1.0to resolvewin32version conflict withflutter_secure_storage_windows
1.0.0 - 2026-05-11 #
🎉 Initial Release #
Added
-
Core Logging System
OmniLoggerinterface with comprehensive logging capabilitiesOmniLoggerClientimplementation with multi-output supportOmniLogConfigconfiguration class with auto-detection of debug/profile/release modes
-
Isolate-Aware Logging
- Automatic isolate detection and context-aware configuration
- Specialized setup methods for different isolate types:
AppLog.setupForDatabaseIsolate()- Optimized for database isolates (Drift, etc.)AppLog.setupForBackgroundIsolate()- Minimal logging for background tasks
- Isolate information helpers and formatting utilities
-
File Logging Features
- Automatic log file rotation based on size limits
- Configurable file retention (by count and age)
- Optional log file compression
- Platform-aware file logging (disabled automatically on web)
-
Smart Configuration
- Auto-configuration based on Flutter build modes:
- Debug Mode: Full logging (debug level), file + console output
- Profile Mode: Structured logging for performance analysis
- Release Mode: Error-only logging, minimal file retention
- Runtime configuration updates for log levels and file logging
- Comprehensive logging statistics and health monitoring
- Auto-configuration based on Flutter build modes:
-
AppLog Static Interface
- Simple setup with
AppLog.setup() - Direct logging with
AppLog.log('ClassName').i('message')pattern - Specialized isolate setup:
AppLog.setupForDatabaseIsolate()AppLog.setupForBackgroundIsolate()
- Memory leak prevention with automatic cleanup
- Simple setup with
-
Multiple Output Support
- Console output for development
- File output with rotation and compression
- JSON and production-friendly formatters
-
Developer Experience
- Automatic fallback to console-only logging on setup failures
- Comprehensive error handling and recovery mechanisms
- Debug utilities for isolate information and logging statistics
- Memory-safe logger tracking with weak references
Usage Examples
// Basic setup
AppLog.setup();
AppLog.log('MyApp').i('Application started');
// Database isolate
AppLog.setupForDatabaseIsolate(isolateName: 'drift_db');
AppLog.log('DatabaseService').d('Query executed successfully');
// Background isolate
AppLog.setupForBackgroundIsolate(isolateName: 'sync_worker');
AppLog.log('SyncService').w('Sync operation took longer than expected');
📋 Known Limitations #
- File logging is not supported on web platform (by design)
- Log file compression requires additional disk I/O operations
- Initial file output creation may have slight startup delay
🔧 Configuration Notes #
- Default log retention: 3 days (debug), 1 day (release)
- Default file size limit: 5MB (debug), 1MB (release)
- Console logging automatically disabled in release mode
Platform Support: ✅ Android, iOS, macOS, Windows, Linux | 🌐 Web (console only)