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.
This commit is contained in:
Guangfei.Zhao
2026-09-03 11:39:04 +08:00
parent d786fc31ff
commit 782fba80bc
39 changed files with 192 additions and 1152 deletions
@@ -44,12 +44,48 @@ void main() {
flavor: AppFlavor.dev,
apiBaseUrl: 'https://api-dev.conti.com',
enableLog: true,
sentryDsn: '',
h5AllowedHosts: <String>{'f6.conti.com'},
);
expect(env.isProd, isFalse);
expect(env.flavorSuffixVisible, isTrue);
expect(env.h5AllowedHosts, contains('f6.conti.com'));
});
test('从内置环境配置读取字段并规范化 H5 域名', () {
final AppEnv env = AppEnv.fromConfig(
flavor: 'uat',
values: <String, Object?>{
'API_BASE_URL': 'https://api-uat.conti.com',
'ENABLE_LOG': true,
'H5_ALLOWED_HOSTS': ' H5.Conti.com, shop.conti.com ',
},
);
expect(env.flavor, AppFlavor.uat);
expect(env.apiBaseUrl, 'https://api-uat.conti.com');
expect(env.enableLog, isTrue);
expect(env.h5AllowedHosts, <String>{'h5.conti.com', 'shop.conti.com'});
});
test('缺失或类型错误的内置配置在启动期失败', () {
expect(
() => AppEnv.fromConfig(
flavor: 'dev',
values: <String, Object?>{'API_BASE_URL': '', 'ENABLE_LOG': true, 'H5_ALLOWED_HOSTS': ''},
),
throwsStateError,
);
expect(
() => AppEnv.fromConfig(
flavor: 'dev',
values: <String, Object?>{
'API_BASE_URL': 'https://api-dev.conti.com',
'ENABLE_LOG': 'true',
'H5_ALLOWED_HOSTS': '',
},
),
throwsStateError,
);
});
});
}