Files
conti-retail-app/docs/13-observability-analytics.md
Guangfei.Zhao 782fba80bc refactor: remove CrashReporter and related logging components
- Removed CrashReporter interface and its implementation, SentryCrashReporter.
- Deleted log buffering functionality and associated LogBuffer class.
- Updated LoggerAppLogger to eliminate dependencies on removed components.
- Simplified logging structure to focus on AppLogger and sensitive data scrubbing.
- Adjusted AppEnv to remove Sentry-related configurations.
- Refactored tests to align with the new logging architecture.
2026-09-03 11:39:04 +08:00

23 lines
1.1 KiB
Markdown

# 13. 日志与埋点
## 决策
首期不接入任何崩溃上报 SDK,也不向第三方传输异常、用户或门店上下文。业务代码通过
`core_logging` 输出经过脱敏的本地日志;行为分析继续通过 `core_analytics` 的抽象接口接入。
## 日志规则
- `AppLogger` 是唯一日志入口;请求日志和业务日志都必须经 `scrubber.dart` 脱敏。
- dev 输出 debug 级别日志,uat 输出 info 及以上,prod 不输出控制台日志。
- 日志不持久化、不上传;不保留无消费者的崩溃黑匣子缓存。
- Provider 失败和未知路由仅记录脱敏日志。业务拒绝、登录失效和主动取消属于预期流程,
不作为错误日志噪音处理。
## 埋点
`Analytics` 仍由 app 层注入。会话建立时设置用户与角色维度,切店时更新门店维度,登出时
先记录登出事件再 reset,避免共用门店设备上的用户上下文串联。
如未来需要崩溃上报,须单独完成合规、数据字段、脱敏、符号表保存和 SDK 选型评审;不得
直接恢复本项目已删除的第三方 SDK 配置。