logServer function
Implementation
Future<void> logServer(String message, String errorCode, String logType) async {
HttpUtilities api = HttpUtilities();
String urlSuffix = "logs";
String requestMethod = "POST";
Map<String, dynamic> getParams = {};
Map<String, dynamic> body = {
'message': '$message ${errorCode.isNotEmpty ? '[$errorCode]' : ''}',
'log_type': logType,
'timestamp': nowToTimestamp(),
};
if (httpSvcDebug) {
logDebug(
'logServer | urlSuffix: $urlSuffix | requestMethod: $requestMethod | body: $body | getParams: $getParams',
);
}
final apiResp = await api.httpsCall(
requestMethod,
urlSuffix,
{},
body,
getParams,
useServerLog: false,
);
if (httpSvcDebug) {
logDebug('logServer | apiResp: $apiResp');
}
}