flutter_logan_pro 1.0.4 copy "flutter_logan_pro: ^1.0.4" to clipboard
flutter_logan_pro: ^1.0.4 copied to clipboard

A high-performance, robust log plugin for Flutter based on Meituan Logan. Fixed truncation and decryption issues.

1.0.4 #

  • Add: getUploadPath([date]) — resolves the on-disk path of the (encrypted) log file for a date so it can be attached to a bug report / shared / emailed instead of uploaded to a Logan server. Returns null when no log exists for that date. On both platforms today's file is flushed and snapshotted first; past dates return the stored file path. (iOS: loganUploadFilePath; Android: Logan.s(dates, SendLogRunnable) with an existence pre-check.)
  • Add: init(minSDCardBytes:) — Android-only free-storage floor. When free space drops below this many bytes, Logan stops writing new logs (native default 50MB). Ignored on iOS, whose floor is hardcoded at 5MB. Documented in the README.
  • Fix (Android): maxFileLen was passed straight to LoganConfig.Builder.setMaxFile(), which multiplies its argument by 1MB internally — so a byte value like 10*1024*1024 became a ~10TB cap, effectively disabling the per-file size limit. maxFileLen (bytes) is now converted to MB, matching the documented contract and iOS behavior. Also read as a Number so byte values above 2^31 aren't dropped.
  • Fix: pre-init log queue is now bounded (max 2000 entries). A long-delayed init() (e.g. waiting on runtime permissions) can no longer let the buffer grow without limit; the oldest entries are dropped with a one-off warning.
  • Fix: logs queued before init() now carry their original timestamp (prefixed to the message), instead of all collapsing onto the init moment when replayed.
  • Fix: iOS send/sendWithHeaders now coerce appId/unionId/deviceId defensively so a stray NSNull can't crash the native upload.
  • Improve: iOS sendWithHeaders now logs a warning when non-empty custom headers are passed (they're unsupported by the native iOS upload API and silently ignored), so an auth-token-dependent upload isn't a silent surprise.
  • Improve: Android setMaxReversedDate now warns via android.util.Log (was println) and explains that retention must be set through init(maxReversedDate:).
  • Security: removed plain-HTTP Aliyun Maven mirrors (allowInsecureProtocol) from the Android build; only HTTPS mirrors remain, avoiding a cleartext supply-chain/MITM risk.
  • Tests: replaced the stale getPlatformVersion Android unit test (wrong package, removed method) with tests for notImplemented and the invalid_url guard.
  • Docs: added a Chinese README (README-zh.md) and clarified getAllFilesInfo units and platform differences.

1.0.3 #

  • Fix: concurrent init() calls no longer return early against a half-initialized logger (which could silently lose queued logs).
  • Fix: stale send callbacks (e.g. arriving after a timeout) can no longer complete a newer send() — each request now carries a unique id matched in the handler.
  • Docs: clarified that iOS's sendWithHeaders ignores custom headers (the native iOS upload API has no header support) and uploads without them; Android honors them.
  • Fix: iOS unchecked NSHTTPURLResponse cast and self-retaining upload block.
  • Fix: iOS log no longer risks a crash on a non-NSNumber type (e.g. NSNull); falls back to type 1.
  • Fix: corrected EXCLUDED_ARCHS typo (i3386i386) in the podspec.
  • Fix: validate that secretKey/secretIV are exactly 16 bytes (Dart + iOS), preventing undecryptable logs from a misconfigured key.
  • Fix: LoganSendResult.isSuccess() no longer requires the server body's code == 200; it now treats HTTP 200 as success and, when a body code is present, accepts the conventional Logan success codes (0 or 200). The previous check could never pass against backends returning code: 0.
  • Fix: Android clearAllLogs now flushes and clears Logan's dedicated logan_cache subdirectory (where the mmap buffer lives) plus the persisted log dir — instead of wiping every file in the shared temporary directory.
  • Fix: date formatting/forwarding so an omitted send date is resolved by the native clock (matches the log file's date); Android date now uses Locale.US to avoid non-Latin digits.
  • Add: getTodaysDate() and setMaxReversedDate() to the Dart API (previously documented but missing).
  • Chore: removed dead getPlatformVersion plumbing from the public class; synced podspec/pubspec versions.

1.0.2 #

  • Fix: send method blocking issue on iOS.
  • Fix: Parameter type mismatch in iOS native code.
  • Add: Timeout mechanism for log sending (default 10s).
  • Add: Better parameter validation in native plugins.

1.0.1 #

  • Internal improvements and bug fixes.
  • Updated documentation.

1.0.0 #

  • Initial release of flutter_logan_pro.
  • High-performance, encrypted logging for Flutter on both iOS and Android.
  • Core features:
    • init: Initialize the logger with encryption keys.
    • log: Write log messages. Supports pre-initialization queueing.
    • send/sendWithHeaders: Upload logs to a server and await a structured LoganSendResult.
    • flush: Manually flush logs to disk.
    • clearAllLogs: Delete all generated log files.
    • getAllFilesInfo: Get metadata for all local log files.
    • setMaxReversedDate: Configure log file retention policy.
    • setDebug: Enable verbose logging from the underlying native libraries.
1
likes
150
points
234
downloads

Documentation

API reference

Publisher

verified publisherjannix.online

Weekly Downloads

A high-performance, robust log plugin for Flutter based on Meituan Logan. Fixed truncation and decryption issues.

Repository (GitHub)

Topics

#logging #performance #monitoring

License

MIT (license)

Dependencies

flutter, flutter_lifecycle_detector, path_provider

More

Packages that depend on flutter_logan_pro

Packages that implement flutter_logan_pro