fix(log-center): add repo_url and make log center URL configurable
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ce53e93864
commit
5d8619450d
@ -11,9 +11,13 @@ LogCenterService logCenterService(Ref ref) {
|
||||
}
|
||||
|
||||
class LogCenterService {
|
||||
static const String _url =
|
||||
'https://qiyuan-log-center-api.airlabs.art/api/v1/logs/report';
|
||||
static const String _baseUrl = String.fromEnvironment(
|
||||
'LOG_CENTER_URL',
|
||||
defaultValue: 'https://qiyuan-log-center-api.airlabs.art',
|
||||
);
|
||||
static const String _url = '$_baseUrl/api/v1/logs/report';
|
||||
static const String _projectId = 'airhub_app';
|
||||
static const String _repoUrl = 'https://gitea.airlabs.art/zyc/rtc_prd.git';
|
||||
|
||||
late final Dio _dio;
|
||||
|
||||
@ -88,8 +92,12 @@ class LogCenterService {
|
||||
|
||||
final payload = {
|
||||
'project_id': _projectId,
|
||||
'environment': kDebugMode ? 'development' : 'production',
|
||||
'environment': const String.fromEnvironment(
|
||||
'ENVIRONMENT',
|
||||
defaultValue: kDebugMode ? 'development' : 'production',
|
||||
),
|
||||
'level': 'ERROR',
|
||||
'repo_url': _repoUrl,
|
||||
'error': {
|
||||
'type': errorType,
|
||||
'message': message.length > 2000 ? message.substring(0, 2000) : message,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user