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 {
|
class LogCenterService {
|
||||||
static const String _url =
|
static const String _baseUrl = String.fromEnvironment(
|
||||||
'https://qiyuan-log-center-api.airlabs.art/api/v1/logs/report';
|
'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 _projectId = 'airhub_app';
|
||||||
|
static const String _repoUrl = 'https://gitea.airlabs.art/zyc/rtc_prd.git';
|
||||||
|
|
||||||
late final Dio _dio;
|
late final Dio _dio;
|
||||||
|
|
||||||
@ -88,8 +92,12 @@ class LogCenterService {
|
|||||||
|
|
||||||
final payload = {
|
final payload = {
|
||||||
'project_id': _projectId,
|
'project_id': _projectId,
|
||||||
'environment': kDebugMode ? 'development' : 'production',
|
'environment': const String.fromEnvironment(
|
||||||
|
'ENVIRONMENT',
|
||||||
|
defaultValue: kDebugMode ? 'development' : 'production',
|
||||||
|
),
|
||||||
'level': 'ERROR',
|
'level': 'ERROR',
|
||||||
|
'repo_url': _repoUrl,
|
||||||
'error': {
|
'error': {
|
||||||
'type': errorType,
|
'type': errorType,
|
||||||
'message': message.length > 2000 ? message.substring(0, 2000) : message,
|
'message': message.length > 2000 ? message.substring(0, 2000) : message,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user