Files
conti-docs/flutter-app/13-observability-analytics.md
T
Guangfei.Zhao acdfc95686 Refactor observability and analytics documentation
- Updated the crash reporting section to clarify the integration of Bugly and sensors analytics.
- Revised the logging rules to ensure sensitive data is scrubbed before logging.
- Enhanced the session management guidelines to ensure user context is correctly set during login and logout processes.
- Consolidated the analytics event tracking strategy, emphasizing backend-driven event logging.
- Removed references to third-party SDKs for crash reporting and analytics, focusing on internal logging mechanisms.
2026-09-03 11:38:54 +08:00

1.1 KiB

13. 日志与埋点

决策

首期不接入任何崩溃上报 SDK,也不向第三方传输异常、用户或门店上下文。业务代码通过 core_logging 输出经过脱敏的本地日志;行为分析继续通过 core_analytics 的抽象接口接入。

日志规则

  • AppLogger 是唯一日志入口;请求日志和业务日志都必须经 scrubber.dart 脱敏。
  • dev 输出 debug 级别日志,uat 输出 info 及以上,prod 不输出控制台日志。
  • 日志不持久化、不上传;不保留无消费者的崩溃黑匣子缓存。
  • Provider 失败和未知路由仅记录脱敏日志。业务拒绝、登录失效和主动取消属于预期流程, 不作为错误日志噪音处理。

埋点

Analytics 仍由 app 层注入。会话建立时设置用户与角色维度,切店时更新门店维度,登出时 先记录登出事件再 reset,避免共用门店设备上的用户上下文串联。

如未来需要崩溃上报,须单独完成合规、数据字段、脱敏、符号表保存和 SDK 选型评审;不得 直接恢复本项目已删除的第三方 SDK 配置。