ApiLogger class
API 请求记录器
提供手动记录 API 请求、响应和错误的方法
Constructors
- ApiLogger.new({required ApiMonitor apiMonitor})
- 创建一个 API 请求记录器
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
logError(
String url, String method, String error, {int? statusCode, Map< String, dynamic> ? headers, dynamic data, Map<String, dynamic> ? queryParameters}) → void - 记录 API 错误(请求失败)
-
logRequest(
String url, String method, {Map< String, dynamic> ? headers, dynamic data, Map<String, dynamic> ? queryParameters}) → void - 记录 API 请求(发送前)
-
logResponse(
String url, String method, int? statusCode, dynamic response, {Map< String, dynamic> ? headers, dynamic data, Map<String, dynamic> ? queryParameters}) → void - 记录 API 响应(请求成功)
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited