當前位置: 首頁>>代碼示例>>Java>>正文


Java Crashlytics.logException方法代碼示例

本文整理匯總了Java中com.crashlytics.android.Crashlytics.logException方法的典型用法代碼示例。如果您正苦於以下問題:Java Crashlytics.logException方法的具體用法?Java Crashlytics.logException怎麽用?Java Crashlytics.logException使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.crashlytics.android.Crashlytics的用法示例。


在下文中一共展示了Crashlytics.logException方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: rapporterOgvisFejl

import com.crashlytics.android.Crashlytics; //導入方法依賴的package包/類
public static void rapporterOgvisFejl(final Activity akt, final Exception e) {
  if (!App.EMULATOR) {
    Crashlytics.logException(e);
    //Mint.logException(e);
  }
  Log.e(e);

  Builder ab = new Builder(akt);
  ab.setTitle("Beklager, der skete en fejl");
  ab.setMessage(e.toString());
  ab.setNegativeButton("Fortsæt", null);
  ab.setPositiveButton("Indsend fejl", new Dialog.OnClickListener() {
    public void onClick(DialogInterface arg0, int arg1) {
      String brødtekst = "Skriv, hvad der skete:\n\n\n---\n";
      brødtekst += "\nFejlspor;\n" + android.util.Log.getStackTraceString(e);
      brødtekst += "\n\n" + lavKontaktinfo();
      App.kontakt(akt, "Fejl DR Radio", brødtekst, Log.log.toString());
    }

  });
  ab.create().show();
}
 
開發者ID:nordfalk,項目名稱:EsperantoRadio,代碼行數:23,代碼來源:Log.java

示例2: onOptionsItemSelected

import com.crashlytics.android.Crashlytics; //導入方法依賴的package包/類
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
        case R.id.action_delete:
            messageArray = adapter.getSelectedMessages();
            for (int i = 0; i < this.selectionCount; i++){
                try {
                    deleteChat(messageArray.get(i).getId());
                } catch (Exception e) {
                    e.printStackTrace();
                    Crashlytics.logException(e);
                }
                //    Toast.makeText(this, "selected IDs: " + messageArray.get(i).getId(), Toast.LENGTH_SHORT).show();
            }
            adapter.deleteSelectedMessages();
            adapter.notifyDataSetChanged();
            //
            break;
        case R.id.action_copy:
            adapter.copySelectedMessagesText(this, getMessageStringFormatter(), true);
            break;
    }
    return true;
}
 
開發者ID:sciage,項目名稱:FinalProject,代碼行數:25,代碼來源:MessageActivity.java

示例3: onStartCommand

import com.crashlytics.android.Crashlytics; //導入方法依賴的package包/類
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
    this.start();

    if(intent != null){
        String deviceAddress = intent.getStringExtra(KEY_MAC_ADDRESS);
        if(deviceAddress != null){
            try{
                BluetoothDevice device = mAdapter.getRemoteDevice(deviceAddress.toUpperCase());
                this.connect(device, false);
            }catch(RuntimeException e){
                EventBus.getDefault().post(new UiToastEvent(e.getMessage()));
                Crashlytics.logException(e);
                Crashlytics.log("MAC ADDRESS: " + KEY_MAC_ADDRESS);
                disconnectService();
                stopSelf();
            }
        }
    }else{
        EventBus.getDefault().post(new UiToastEvent(getString(R.string.unknown_error)));
        disconnectService();
        stopSelf();
    }

    return Service.START_NOT_STICKY;
}
 
開發者ID:zeevy,項目名稱:grblcontroller,代碼行數:27,代碼來源:GrblSerialService.java

示例4: SuraTimingDatabaseHandler

import com.crashlytics.android.Crashlytics; //導入方法依賴的package包/類
private SuraTimingDatabaseHandler(String path) throws SQLException {
  Crashlytics.log("opening gapless data file, " + path);
  try {
    mDatabase = SQLiteDatabase.openDatabase(path, null,
        SQLiteDatabase.NO_LOCALIZED_COLLATORS, new DefaultDatabaseErrorHandler());
  } catch (SQLiteDatabaseCorruptException sce) {
    Crashlytics.log("database corrupted: " + path);
    mDatabase = null;
  } catch (SQLException se) {
    Crashlytics.log("database at " + path +
        (new File(path).exists() ? " exists" : " doesn't exist"));
    Crashlytics.logException(se);
    mDatabase = null;
  }
}
 
開發者ID:Elias33,項目名稱:Quran,代碼行數:16,代碼來源:SuraTimingDatabaseHandler.java

示例5: logExceptionToFabric

import com.crashlytics.android.Crashlytics; //導入方法依賴的package包/類
public static void logExceptionToFabric(Throwable ex, String tag) {

        if (ex == null) {
            return;
        }

        try {
            ex.printStackTrace();
        } catch (StackOverflowError ignored) {
            Crashlytics.log("StackOverflowError in Logger " + ignored);
            return;
        }

        if (Fabric.isInitialized() && !TextUtils.isEmpty(ex.getMessage())) {
            Crashlytics.logException(ex);
        }
    }
 
開發者ID:ukevgen,項目名稱:BizareChat,代碼行數:18,代碼來源:Logger.java

示例6: handleException

import com.crashlytics.android.Crashlytics; //導入方法依賴的package包/類
@Override
/**
 * Exception handler with Crashlytics support, also it will be shown in logcat.
 */
public void handleException(Throwable throwable, DataMap map) {
    Timber.d("HandleException %s", throwable);
    Crashlytics.setBool("wear_exception", true);
    Crashlytics.setString("board", map.getString("board"));
    Crashlytics.setString("fingerprint", map.getString("fingerprint"));
    Crashlytics.setString("model", map.getString("model"));
    Crashlytics.setString("manufacturer", map.getString("manufacturer"));
    Crashlytics.setString("product", map.getString("product"));
    Crashlytics.setString("api_level", map.getString("api_level"));

    Crashlytics.logException(throwable);
}
 
開發者ID:matejdro,項目名稱:WearVibrationCenter,代碼行數:17,代碼來源:CrashlyticsExceptionWearHandler.java

示例7: writeTranslationList

import com.crashlytics.android.Crashlytics; //導入方法依賴的package包/類
void writeTranslationList(TranslationList list) {
  File cacheFile = getCachedFile();
  try {
    File directory = cacheFile.getParentFile();
    boolean directoryExists = directory.mkdirs() || directory.isDirectory();
    if (directoryExists) {
      if (cacheFile.exists()) {
        cacheFile.delete();
      }
      Moshi moshi = new Moshi.Builder().build();
      JsonAdapter<TranslationList> jsonAdapter = moshi.adapter(TranslationList.class);
      BufferedSink sink = Okio.buffer(Okio.sink(cacheFile));
      jsonAdapter.toJson(sink, list);
      sink.close();
      quranSettings.setLastUpdatedTranslationDate(System.currentTimeMillis());
    }
  } catch (Exception e) {
    cacheFile.delete();
    Crashlytics.logException(e);
  }
}
 
開發者ID:Elias33,項目名稱:Quran,代碼行數:22,代碼來源:TranslationManagerPresenter.java

示例8: parseLimit

import com.crashlytics.android.Crashlytics; //導入方法依賴的package包/類
private Double parseLimit(String limit) {
    if (limit == null || limit.isEmpty()) return null;

    Integer num;
    try {
        //Overpass maxspeed uses whole numbers. Example limit: "35 mph"
        num = Integer.parseInt(limit.replaceAll("[^0-9]", "")); //remove all non-digit characters
    } catch (NumberFormatException e) {
        Crashlytics.log(Log.ERROR, OverpassManager.class.getSimpleName(), "Limit missing digits: " + limit);
        Crashlytics.logException(e);
        return null;
    }

    if (limit.contains("mph")) {
        return UnitUtils.mphToMs(num);
    } else if (limit.contains("knots")) {
        return UnitUtils.knotsToMs(num);
    } else { //kph if unit is not specified in response
        return UnitUtils.kphToMs(num);
    }
}
 
開發者ID:jakehilborn,項目名稱:speedr,代碼行數:22,代碼來源:OverpassManager.java

示例9: sendCrash

import com.crashlytics.android.Crashlytics; //導入方法依賴的package包/類
public static void sendCrash(Exception e) {
    try {
        Crashlytics.logException(e);
    }
    catch (IllegalStateException ignored) {
    }
}
 
開發者ID:mkeresztes,項目名稱:AndiCar,代碼行數:8,代碼來源:AndiCarCrashReporter.java

示例10: exception

import com.crashlytics.android.Crashlytics; //導入方法依賴的package包/類
@Override
public void exception(Throwable error) {
    // Crashlytics.logException does not print to Logcat, unlike Crashlytics.log. Not using
    // android.util.Log.e directly here because we would like caught exceptions to also show up
    // in the logs of other exceptions, as they may be correlated.
    e("Exception", android.util.Log.getStackTraceString(error));
    Crashlytics.logException(error);
}
 
開發者ID:TryGhost,項目名稱:Ghost-Android,代碼行數:9,代碼來源:ReleaseLogger.java

示例11: sendMessage

import com.crashlytics.android.Crashlytics; //導入方法依賴的package包/類
private void sendMessage(String LogLevel, String message) {

        JSONObject object = new JSONObject();
        try {
            object.put("device_id", deviceID);
            object.put("log_level", LogLevel);
            object.put("message", message);
            object.put("time_stamp", System.currentTimeMillis());
        } catch (JSONException e) {
            Crashlytics.logException(e);

            e.printStackTrace();
        }
        messageQueue.add(object);
    }
 
開發者ID:dji-sdk,項目名稱:Android-Bridge-App,代碼行數:16,代碼來源:DJIRemoteLogger.java

示例12: addDynamicShortcut

import com.crashlytics.android.Crashlytics; //導入方法依賴的package包/類
private void addDynamicShortcut(Place place) {
    try {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
            ShortcutManager shortcutManager = getSystemService(ShortcutManager.class);
            String name = HTTextUtils.isEmpty(place.getName()) ? place.getAddress() : place.getName();
            int count = 0;
            if (shortcutManager.getDynamicShortcuts() != null) {
                count = shortcutManager.getDynamicShortcuts().size();
            }
            if (count > 2) {
                String id = shortcutManager.getDynamicShortcuts().get(0).getId();
                List<String> shortcutIds = new ArrayList<>();
                shortcutIds.add(id);
                shortcutManager.removeDynamicShortcuts(shortcutIds);
            }

            List<ShortcutInfo> shortcut = new ArrayList<>();

            shortcut.add(0, new ShortcutInfo.Builder(this, place.getLocation().getLatLng().toString())
                    .setShortLabel(name)
                    .setIcon(Icon.createWithResource(this, R.drawable.ic_marker_gray))
                    .setIntent(new Intent(Intent.ACTION_VIEW,
                            Uri.parse("share.location://hypertrack")))
                    .build());
            shortcutManager.addDynamicShortcuts(shortcut);
        }
    } catch (Exception e) {
        Crashlytics.logException(e);
    }
}
 
開發者ID:hypertrack,項目名稱:hypertrack-live-android,代碼行數:31,代碼來源:Home.java

示例13: log

import com.crashlytics.android.Crashlytics; //導入方法依賴的package包/類
@Override
protected void log(int priority, String tag, String message, Throwable t) {
    if (t != null) {
        Crashlytics.log(priority, tag, message);
        Crashlytics.logException(t);
    }
}
 
開發者ID:matejdro,項目名稱:WearVibrationCenter,代碼行數:8,代碼來源:TimberCrashlytics.java

示例14: log

import com.crashlytics.android.Crashlytics; //導入方法依賴的package包/類
@Override
protected void log(int priority, String tag, String message, Throwable t) {
    Crashlytics.log(priority, message, tag);
    if (t != null) {
        Crashlytics.logException(t);
    }
    // If this is an error or a warning, log it as a exception so we see it in Crashlytics.
    if (priority >= Log.ERROR) {
        Crashlytics.logException(new Throwable(message));
    }
}
 
開發者ID:fekracomputers,項目名稱:IslamicLibraryAndroid,代碼行數:12,代碼來源:IslamicLibraryApplication.java

示例15: onExportWalletError

import com.crashlytics.android.Crashlytics; //導入方法依賴的package包/類
private void onExportWalletError(Throwable throwable) {
    Crashlytics.logException(throwable);
    exportWalletError.postValue(
            new ErrorEnvelope(C.ErrorCode.UNKNOWN, TextUtils.isEmpty(throwable.getLocalizedMessage())
                            ? throwable.getMessage() : throwable.getLocalizedMessage()));
}
 
開發者ID:TrustWallet,項目名稱:trust-wallet-android,代碼行數:7,代碼來源:WalletsViewModel.java


注:本文中的com.crashlytics.android.Crashlytics.logException方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。