本文整理汇总了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();
}
示例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;
}
示例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;
}
示例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;
}
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例9: sendCrash
import com.crashlytics.android.Crashlytics; //导入方法依赖的package包/类
public static void sendCrash(Exception e) {
try {
Crashlytics.logException(e);
}
catch (IllegalStateException ignored) {
}
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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));
}
}
示例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()));
}