showLog static method

void showLog(
  1. dynamic data, {
  2. bool? showLog,
  3. bool enableJsonEncode = true,
  4. bool showPrint = false,
  5. required String logName,
})

Implementation

static void showLog(data,
    {bool? showLog,
    bool enableJsonEncode = true,
    bool showPrint = false,
    required String logName}) {
  try {
    if (HttpCalls.showAPILogs ?? showLog ?? kDebugMode) {
      showPrint
          ? debugPrint(data)
          : log(enableJsonEncode ? jsonEncode(data) : data,
              time: DateTime.timestamp(), name: 'HttpCalls=> $logName');
    }
  } catch (e) {
    log('getting exception showing log', time: DateTime.timestamp());
  }
}