logError method

void logError(
  1. Object e,
  2. StackTrace st
)

log error

Implementation

void logError(Object e, StackTrace st) {
  // if (!kReleaseMode) log('${e.toString()} ${st.toString()}');
  ApiService().request(
    method: ApiMethod.post,
    endpoint: ApiEndpoints.logs,
    body: {
      ApiKeys.data: [
        LogModel(
          stack: st.toString(),
          message: e.toString(),
          level: LogLevel.error,
          time: DateTime.now().millisecondsSinceEpoch,
        ).toMap(),
      ],
    },
  );
}