搜尋套件、儲存庫與 APP 分類

套件詳情v0.0.1

cross_logger

跨平台日誌記錄器

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
56
喜歡數
0
Pub 分數
110

安裝套件

flutter pub add cross_logger

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

Cross_logger 是一個適用於 Flutter 的跨平台日誌記錄套件,為 Android、iOS、Web、macOS、Windows 和 Linux 提供統一的日誌介面。它支援結構化日誌記錄,並可自訂日誌層級(例如:debug、info、warning、error),並能順暢整合至各種輸出目標,如主控台、檔案或外部服務。專為除錯與監控設計,幫助開發者在各個平台上一致地追蹤應用程式行為。此套件輕量、易於設定,適用於開發與生產環境。

適用情境

  • 除錯多平台應用程式
  • 即時監控應用行為
  • 擷取記錄以進行問題分析
  • 與 CI/CD 流水線整合
  • 跨裝置的集中式日誌管理

主要特色

  • 支援所有主要的Flutter平台
  • 可設定的日誌等級
  • 結構化日誌格式
  • 可擴充的輸出處理程式
  • 簡單的 API,設定簡單

適合對象

  • 開發跨平台 Flutter 應用的開發者
  • 需要一致日誌記錄實務的團隊
  • 需要詳細執行時診斷的應用程式
  • 具有嚴格調試需求的專案
  • 具有可觀測性需求的生產應用

使用建議

  • 可能需要額外設定以實現進階路由
  • 高頻率日誌記錄場景中的效能影響
  • 基於檔案的日誌記錄可能需要磁碟空間管理
  • 未設計用於無整合的情況下即時遠端日誌串流傳輸
  • 與企業級解決方案相比,內建過濾功能有限

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

📝 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

  1. Initialize the logger final logger = await LoggerFacade.initialize( 'ws://your-websocket-url', true, // encryption enabled );
  2. 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.)

所屬分類

依賴

依賴清單 8 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。