log method
Implementation
Future<void> log({
required String url,
required int statusCode,
required Map<String, String> header,
required Map<String, dynamic> requestBody,
required String responseBody,
}) async {
try {
httpConsolePrint(url, statusCode, header, requestBody, responseBody);
if (!AppLogger.instance.configuration.httpLog) return;
final logModel = LogModel(
id: LogType.API,
data: HttpLogModel(
appInfo: await AppInfo.instance(),
url: url,
header: header,
requestBody: requestBody,
responseStatus: statusCode.toString(),
response: responseBody,
),
);
AppLogger.instance.callBackFun(logModel);
} catch (e) {
debugPrint('App logger error: $e');
}
}