Skip to content

chore: remove deprecated setLogsDelegate calls from webtrit_phone#1251

Draft
SERDUN wants to merge 8 commits intodevelopfrom
feat/native-file-logging
Draft

chore: remove deprecated setLogsDelegate calls from webtrit_phone#1251
SERDUN wants to merge 8 commits intodevelopfrom
feat/native-file-logging

Conversation

@SERDUN
Copy link
Copy Markdown
Member

@SERDUN SERDUN commented May 5, 2026

Switches to native file logging — no longer routing callkeep logs through Flutter delegate channels.

Previously CallkeepLogs was wired up as a setLogsDelegate subscriber so Kotlin logs would flow back through the Flutter channel into the Dart logging system. This coupled log visibility to the Flutter isolate lifecycle.

Now Kotlin services write directly to the shared log file and Android logcat unconditionally (handled in webtrit_callkeep). The delegate bridge is no longer needed on the Flutter side.

SERDUN added 7 commits May 5, 2026 14:52
Switches to native file logging — no longer routing callkeep logs
through Flutter delegate channels.
- AppPath: add logFilePath getter (single source of truth for app_logs.log)
- LogRecordsRepository: accept logFilePath instead of directory path
- bootstrap: use appPath.logFilePath instead of temporaryPath
- main_shell: use appPath.logFilePath for CallkeepAndroidOptions.logFilePath
…e watch

NativeLogForwarder watches _native.log via Directory.watch() (inotify).
On file change it reads new lines and emits them through Logger('callkeep'),
which routes to RotatingFileAppender (app_logs.log) and Logz.io appender.
AppPath exposes nativeLogFilePath. cleanLogs() also deletes the native files.
- Add NativeLogForwarder to IsolateContext so native logs are captured
  even when the main isolate is not active; PushIsolateContext reuses
  the same forwarder via super to avoid duplication
- Log SEVERE callkeep records to Crashlytics recordError (not just breadcrumb)
- Fix silent catch in NativeLogForwarder: re-log via _logger.warning
- Add unit tests for NativeLogForwarder covering level parsing, blank-line
  skipping, incremental forwarding, truncation reset, and dispose
- Document .1 rotation limit in cleanLogs and nativeLogFilePath getter
@WebTrit WebTrit deleted a comment from claude Bot May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant