-
Notifications
You must be signed in to change notification settings - Fork 8
Logging System and Maintenance
LogManager unifies Android logcat, in-app live logs, and private file logs. Logs are evidence projections of state and events, never the source of business state.
-
enableActivityLogcontrols file logs under private app storage atfiles/logs. -
enableDebugModerequests live logs;LiveLogStoreis enabled only when debug mode is on and runtime logging is not suppressed. - Detail categories are AUDIO_STREAM, VIDEO_STREAM, CONTROL_STREAM, EVENT_STREAM, SHELL_STREAM, and MANAGEMENT.
-
dControl,dShell, anddManagementconstruct and emit detailed messages only when their category is enabled. - Ordinary debug/info tags are also filtered through tag-to-category mapping. Warn/error still obey game runtime suppression.
- A connected game session may call
setRuntimeLoggingSuppressed(true)to pause the in-app log paths and restore user settings afterward.
File names include app version and date. A file over 10 MiB rolls to a new file. Users can list, read, delete, clear all, or clear old files. The writer runs on an IO scope and flushes each write, so every new high-frequency log must account for this cost.
-
TelemetryPreferencesstores an independent enabled flag, installation UUID, and last uploaded local date. The current default is enabled; the About page can disable it, and re-enabling requires the confirmation dialog. - After onboarding is hidden, app startup uploads the previous local day's matching activity logs plus
files/telemetry/Telemetry_<date>.logto the build-configured HTTPS endpoint. Input is capped at 20 MiB before gzip and carries a SHA-256 header. If no log exists, or that date was already uploaded, the client sends a ping instead. - The server receives the request IP. Ordinary activity logs may contain endpoints and other diagnostics. The dedicated telemetry journal keeps only normalized session, connection, candidate, management, and pairing outcomes and removes session ids, endpoint identity, and free-form verbose messages.
- Telemetry does not upload screenshots or remote video. Network failure is logged and does not block startup.
| Stage | Tags | Purpose |
|---|---|---|
| App/Session |
SAPP, MAIN, SVM, SCLI
|
Entry, session, and client orchestration |
| ADB |
ADBC, ADBP, USBC, SSVC
|
Connection, pairing, USB, foreground protection |
| Server/Protocol |
SSVR, SKPK, SEVT
|
Server shell, packets, event projections |
| Media |
VDEC, ADEC, VCSL, ACSL
|
Decoders and selectors |
| Remote/Control |
RDSP, TOCH, CTRL, FCTL
|
Surface, touch, control, floating menu |
| Management | MGMT |
Management commands and page actions |
LogTags.kt is authoritative for the full values. A new tag also needs a detail category, default behavior, frequency decision, and troubleshooting entry. Do not create a tag for one class without a domain reason.
- Runtime diagnostic messages are written in English regardless of the selected UI language so tags, search terms, device reports, and cross-device troubleshooting remain stable. When a log reuses a
TextPair, it selects.english;.get()remains for user-visible localized copy, not diagnostic language selection. - VERBOSE/DEBUG: optional diagnostics and high-frequency details.
- INFO: sparse important lifecycle conclusions.
- WARN: recoverable anomalies, fallback, retries, or unexpected state.
- ERROR: operation failure, protocol corruption, or terminal state requiring attention.
Main-path logs should include session or transport identity, phase, resource identity such as SCID/port/socket type, and result. Never log pairing codes, keys, clipboard text, tokens, or complete private-file content; redact commands and paths when required.
Closure signals such as EOF, socket closed/reset, and broken pipe receive a concise reason and unified classification so stream, decoder, and monitor do not print the same stack repeatedly. Protocol errors, invalid lengths, MediaCodec failures, and unknown exceptions retain the complete throwable.
ScrcpyEventLogger uses each event's level and category. Types marked for sampling log every 100th event; lifecycle and failure are not sampled. Finer media and packet logs also obey their detail category. String sampling must not replace source counters or performance counters.
- A new tag exists in
LogTags.ktand is mapped to a category when needed. - A high-frequency success path does not log every packet or frame by default.
- One primary error represents a failure; other records provide correlated context without duplicate stacks.
- Logs identify whether failure stopped at ADB, server, socket, metadata, decoder, Surface, or control.
- Tests and review cover sensitive-data exposure.
-
TelemetryJournalTestprotects normalization and identity stripping; changes to uploaded sources, retention, endpoint headers, or default enablement must update the user-facing Settings page and this contract together. - Business code never parses log text as state; policy uses structured issues and events.
- New or changed diagnostics remain English and do not accidentally switch with the UI locale.
- Overview / 总览
- Quick Start / 快速开始
- Connection & Pairing / 连接设备与配对
- Session Management / 会话管理
- Remote Control / 远程控制
- Settings / 设置
- Management Features / 管理功能
- FAQ / 常见问题
- Overview / 总览
- Technical Index / 技术文档索引
- Audit Checklist / 初始化与更新清单
- Conventions / 文档维护约定
- Architecture / 架构
- Module Map / 模块地图与边界
- Runtime Path / 运行时主链路
- Session State / 会话状态与事件
- Session Lifecycle / 会话配置与连接生命周期
- ADB, USB & Wireless / ADB、USB 与无线
- ADB Lifecycle / ADB 连接生命周期
- Pairing / 设备配对与无线调试
- Codecs / 编码与解码
- Remote Interaction / 远程交互性能与悬浮菜单
- Clipboard / 剪贴板同步
- Management / 管理功能
- Events & Shell / 事件、监控与 Shell
- Logging / 日志系统与维护
- Troubleshooting / 分层排障方法
- UI Design / UI 设计系统
- Bilingual Copy / 双语与文案
- Remote UI Analysis / 远程 UI 布局分析
- Engineering Rules / 工程与验证规则
- External Research / 外部研究与取舍
Technical topics appear here only after their page-level audit is complete. / 技术主题仅在完成逐页审核后加入侧边栏。