refactor: debug logs

This commit is contained in:
cogwheel0
2025-08-20 22:15:26 +05:30
parent 9a5c5a573f
commit 4dc9ce1762
27 changed files with 1965 additions and 2195 deletions

View File

@@ -2,6 +2,7 @@ import 'package:dio/dio.dart';
import 'package:flutter/foundation.dart';
import 'api_error.dart';
import 'error_parser.dart';
import '../utils/debug_logger.dart';
/// Comprehensive API error handler with structured error parsing
/// Handles all types of API errors and converts them to standardized format
@@ -319,7 +320,7 @@ class ApiErrorHandler {
debugPrint(' Status: ${dioError.response?.statusCode}');
if (dioError.response?.data != null) {
debugPrint(' Response: ${dioError.response?.data}');
DebugLogger.error('Response data available (truncated for security)');
}
if (dioError.requestOptions.data != null) {

View File

@@ -2,6 +2,7 @@ import 'package:dio/dio.dart';
import 'package:flutter/foundation.dart';
import 'api_error_handler.dart';
import 'api_error.dart';
import '../utils/debug_logger.dart';
/// Dio interceptor for automatic error handling and transformation
/// Converts all HTTP errors into standardized ApiError format
@@ -152,7 +153,7 @@ class ApiErrorInterceptor extends Interceptor {
// Log response data if available and not too large
final responseData = originalError.response?.data;
if (responseData != null && responseData.toString().length < 1000) {
debugPrint(' Response: $responseData');
DebugLogger.error('Response data available (truncated for security)');
}
}