当前位置: 首页>>代码示例>>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;未经允许,请勿转载。