π Encrypted Logging Package (Flutter / Dart)
A lightweight, modular logging system for Flutter and Dart applications that supports:
- β
Local storage via IndexedDB (using
idb_shim
) - π Encryption using AES (via
encrypt
) - π WebSocket real-time logging
- βοΈ HTTP blob upload support
- π¦ Built for web-first apps with expandability for mobile support
π¦ Installation
Add the following dependencies to your pubspec.yaml
:
π§± Architecture Overview
- This package is structured with clean architecture principles:
- EncryptionService: Handles AES encryption/decryption.
- LogEntry: Data model with encrypted log message.
- Log: Domain entity.
- LocalDatabase: IndexedDB wrapper for storing logs.
- HTTPHandler: Uploads logs as files to a remote server.
- WebSocketClient: Sends logs over WebSocket.
- LogUseCase: Orchestrates log flow (store, encrypt, send).
- LoggerFacade: One-stop interface to log messages.
π Usage
- Initialize the logger final logger = await LoggerFacade.initialize( 'ws://your-websocket-url', true, // encryption enabled );
- await logger.log("Hello, this is a test log!");
β Features
Feature | Status Local logging | β Done AES Encryption | β Done WebSocket send | β Done HTTP blob upload | β Done Test coverage | β Done
β¨ Contributions
PRs welcome! Feel free to fork, improve, or extend the system with new logging channels (e.g. Firebase, Sentry, etc.)