Files
flutterApp/lib/core/error/exception_logger.dart
2026-01-21 13:27:55 +08:00

19 lines
600 B
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// lib/core/error/exception_logger.dart
abstract class ExceptionLogger {
Future<void> init();
// 捕获异常
Future<void> captureException(dynamic exception, {dynamic stackTrace});
// 捕获普通消息(Debug 用)
Future<void> captureMessage(String message, {bool isWarning = false});
// 设置用户信息
Future<void> setUserContext(String userId, {String? username});
// 设置设备/环境标签
Future<void> setTag(String key, String value);
// 添加行为足迹
void addBreadcrumb(
String message, {
String? category,
Map<String, dynamic>? data,
});
}