ghost_logger 1.3.1
ghost_logger: ^1.3.1 copied to clipboard
Can be Unseen but always there. Stealing errors before they steal your users' experience. A flexible logging utility with optional crash reporting integration.
1.3.1 #
- Fix: Replaced the boolean re-entrancy guard in
_writeToFilewith a serial write queue (Future-chaining). Concurrent fire-and-forget log calls no longer race against each other, eliminating silent log drops when many entries are written in quick succession. - New: Added
GhostLogger.flush()— awaits all pending file writes before returning. Call this in your app's dispose or shutdown handler to ensure no buffered entries are lost before the process exits. No changes are required at existing call sites.
1.3.0 #
- Feature: Added
GhostLogger.sendDiagnosticLogs()to bridge local file logs directly to your crash reporting service for silent bug tracking. - Breaking Change: Added
sendDiagnosticLogs()to theCrashReporterinterface. If you have a custom crash reporter implementation, you must override this new method.
1.2.0 #
Features #
Long Message Support (LoggerType.print)
- Long messages are now automatically split into 1,000-character chunks internally, preventing
print()from clipping output - Added
maxMessageLengthparameter toGhostLogger.configure()— set a character cap on printed messages; messages exceeding the limit are truncated with a... [truncated]indicator - Truncation applies to both
LoggerType.printandLoggerType.console; stack traces are always printed in full regardless of this setting
File Logging
- Added per-session, per-level log file persistence — logs are written to the application support directory as
ghost_logger_{level}_{timestamp}.log - New
configure()flags:storeDebug,storeInfo,storeWarnings,storeErrors— all default tofalse; enable only the levels you need - File logging runs in release builds — not gated by
isDebugMode, making it suitable for production monitoring - Added
onLogFileUpdatedcallback — fires each time a line is written to a file, receiving theFileandLogLevel - Added
GhostLogger.exportLogs()— returns active log files on demand; accepts aLogExportScopeparameter (currentSessionorallSessions) to access files from previous sessions too - Added
GhostLogger.cleanOldLogs()— deletes log files older thanlogRetentionDays(default: 7 days); passincludeRecents: trueto wipe all log files regardless of age - Added
autoCleanOldLogsflag (default:true) — runscleanOldLogs()automatically at startup when any store flag is enabled - Added
logRetentionDaysparameter (default:7) — controls how long log files are kept before cleanup - Added reentrancy guard — prevents infinite loops when
onLogFileUpdatedcallsGhostLogger.log*()internally - Platform note: File logging is not supported on Flutter Web; a debug warning is emitted if attempted
New Exports
LogExportScopeenum is now exported from the package barrel file
Dependencies #
- Added
path_provider: ^2.1.5for cross-platform application support directory access
1.1.1 #
- DOCS: Updated README with convenience methods examples
- DOCS: Added comprehensive API reference
- DOCS: Improved Firebase Crashlytics integration guide
- DOCS: Added troubleshooting section
- No code changes
1.1.0 #
Features #
- Added convenience logging methods:
GhostLogger.logDebug()- Debug loggingGhostLogger.logInfo()- Info loggingGhostLogger.logWarning()- Warning loggingGhostLogger.logError()- Error logging
Bug Fixes #
- Fixed color output issues in Android Studio console
- Improved color reset reliability with separate print calls
Breaking Changes #
- Removed
LoggerType.loggerenum value - Use
LoggerType.consoleinstead if you were usingLoggerType.logger
1.0.0 #
- Added colored terminal output for log levels
isDebugModenow defaults tokDebugMode- Package now depends on Flutter SDK
0.1.0 #
- Initial release