APISonar


android.util.Log.getStackTraceString

> android > util > Log > getStackTraceString
android APIs util APIs Log APIs getStackTraceString APIs

Example 1
public static void onDbCorruption(String tag, String message, Throwable stacktrace) {
        try {
            getContentService().onDbCorruption(tag, message, Log.getStackTraceString(stacktrace));
        } catch (RemoteException e) {
            e.rethrowFromSystemServer();
        }
    }
Example 2
private void println(int priority, String message, Throwable t) {
        if (message == null) {
            message = "";
        }

        if (t != null) {
            message += '\n' + Log.getStackTraceString(t);
        }
        Log.println(priority, mTag, message);
    }
Example 3
public void addTrace() {
        String trace = Log.getStackTraceString(new Throwable());
        synchronized (this) {
            if (mTraces.containsKey(trace)) {
                mTraces.put(trace, mTraces.get(trace) + 1);
            } else {
                mTraces.put(trace, Long.valueOf(1));
            }
        }
    }
Example 4
public void onCreate() {
        super.onCreate();
        sApplication = this;

        RxJavaPlugins.setErrorHandler(new Consumer<Throwable>() {
            @Override
            public void accept(Throwable throwable) throws Exception {
                Log.e(TAG, Log.getStackTraceString(throwable));
            }
        });

        init();
    }
Example 5
private static void error(String msg, Exception e) {
        Log.e(TAG, msg);
        if (e != null) {
            Log.e(TAG, Log.getStackTraceString(e));
        }
    }
Example 6
public static void showStackTrace(String tag) {
        if (!TextUtils.isEmpty(tag)) {
            logDebug(tag, Log.getStackTraceString(new Throwable()));
        }
    }
Example 7
public static void printException(String msg, Throwable e) {
        if (isEnable) {
            DEFAULT_LOGHANDLER.publish("Log_StackTrace", Log.ERROR, msg + '\n' + Log.getStackTraceString(e));
        }
    }
Example 8
public void setFeedItemlist(List<FeedItem> items) {
        try {
            db.beginTransactionNonExclusive();
            for (FeedItem item : items) {
                setFeedItem(item, true);
            }
            db.setTransactionSuccessful();
        } catch (SQLException e) {
            Log.e(TAG, Log.getStackTraceString(e));
        } finally {
            db.endTransaction();
        }
    }
Example 9
public static void exception(Object obj, Throwable throwable) {
        wString(obj.toString(), Log.getStackTraceString(throwable));

        if (!debuggable) {
            forceException(obj, throwable);
        }

        if (fileLog) {
            FileLog.e(obj.toString(), throwable);
        }
    }
Example 10
static void loadData(Context context) throws RemoteException {
        try {
            synchronized (lock) {
                if (db == null)
                    db = getDatabase(context);
                if (hooks == null)
                    loadHooks(context);
            }
        } catch (RemoteException ex) {
            throw ex;
        } catch (Throwable ex) {
            Log.e(TAG, Log.getStackTraceString(ex));
            throw new RemoteException(ex.getMessage());
        }
    }
Example 11
public void printErrStackTrace(String s, Throwable throwable, String s1, Object... objects) {
        String log = objects == null ? s1 : String.format(s1, objects);
        if (log == null) {
            log = "";
        }
        log = log + "  " + Log.getStackTraceString(throwable);
        Log.e(s, log);
    }
Example 12
public void setDownloadPath(String path)
    {
        try {
            th.moveStorage(path, MoveFlags.ALWAYS_REPLACE_FILES);

        } catch (Exception e) {
            Log.e(TAG, "Error changing save path: ");
            Log.e(TAG, Log.getStackTraceString(e));
        }
    }
Example 13
private File copyUpdateFileToDataOtaPackageDir() {
        try {
            File destination = createNewFileWithPermissions();
            copyToFile(destination);
            return destination;
        } catch (IOException e) {
            Log.w(TAG, "Failed to copy update file to OTA directory", e);
            notifyCallbackOnError(
                    InstallSystemUpdateCallback.UPDATE_ERROR_UNKNOWN,
                    Log.getStackTraceString(e));
            return null;
        }
    }
Example 14
public void onCreate() {
        super.onCreate();
        Log.i(TAG, "Create version=" + Util.getSelfVersionName(this));

        mPrevHandler = Thread.getDefaultUncaughtExceptionHandler();
        Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
            @Override
            public void uncaughtException(Thread thread, Throwable ex) {
                Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex));
                Util.sendCrashReport(ex, ApplicationEx.this);
                if (mPrevHandler != null)
                    mPrevHandler.uncaughtException(thread, ex);
            }
        });
    }
Example 15
public boolean equals(Object o) {
        try {
            Photo other = (Photo) o;
            return this.path.equalsIgnoreCase(other.path);
        } catch (ClassCastException e) {
            Log.e(TAG, "equals: " + Log.getStackTraceString(e));
        }
        return super.equals(o);
    }
Example 16
public static StringBuilder readString(InputStreamReader reader) {
        StringBuilder sb = new StringBuilder(2048);
        char[] read = new char[128];
        try {
            for (int i; (i = reader.read(read)) >= 0; sb.append(read, 0, i)) ;
        } catch (Throwable ex) {
            Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex));
        }
        return sb;
    }
Example 17
private void runNextLoadTorrentTask() {
        LoadTorrentTask task = null;
        try {
            if (!loadTorrentsQueue.isEmpty())
                task = loadTorrentsQueue.poll();
        } catch (Exception e) {
            Log.e(TAG, Log.getStackTraceString(e));

            return;
        }

        if (task != null)
            loadTorrentsExec.execute(task);
    }
Example 18
public synchronized static void log(Throwable t) {
		if (DexLog.DEBUG) {
			Log.e(TAG, Log.getStackTraceString(t));
		}
	}
Example 19
public static void i(String tag, String message, Throwable tr) {
        if (Log.INFO >= logLevel) {
            Log.i(tag, message + '\n' + Log.getStackTraceString(tr));
        }

        r(getFormattedLog(Log.INFO, tag, message));
    }
Example 20
public void resetAllMediaPlayedDuration() {
        try {
            db.beginTransactionNonExclusive();
            ContentValues values = new ContentValues();
            values.put(KEY_PLAYED_DURATION, 0);
            db.update(TABLE_NAME_FEED_MEDIA, values, null, new String[0]);
            db.setTransactionSuccessful();
        } catch (SQLException e) {
            Log.e(TAG, Log.getStackTraceString(e));
        } finally {
            db.endTransaction();
        }
    }
Example 21
public void log(Level level, String msg, Throwable th) {
        if (level != Level.OFF) {
            // That's how Log does it internally
            Log.println(mapLevel(level), tag, msg + "\n" + Log.getStackTraceString(th));
        }
    }
Example 22
private List<String> getNonIndexablesKeysFromRemoteProvider(String packageName,
                                                                String authority) {
        try {
            final Context packageContext = mContext.createPackageContext(packageName, 0);

            final Uri uriForNonIndexableKeys = buildUriForNonIndexableKeys(authority);
            return getNonIndexablesKeys(packageContext, uriForNonIndexableKeys,
                    SearchIndexablesContract.NON_INDEXABLES_KEYS_COLUMNS);
        } catch (PackageManager.NameNotFoundException e) {
            Log.w(LOG_TAG, "Could not create context for " + packageName + ": "
                    + Log.getStackTraceString(e));
            return EMPTY_LIST;
        }
    }
Example 23
static UserHandle getUserHandle(int userid) {
        try {
            // public UserHandle(int h)
            Constructor ctor = UserHandle.class.getConstructor(int.class);
            return (UserHandle) ctor.newInstance(userid);
        } catch (Throwable ex) {
            Log.e(TAG, Log.getStackTraceString(ex));
            return Process.myUserHandle();
        }
    }
Example 24
private RuntimeException handleExceptionOnEventDispatch(Exception e) {
		if (e instanceof RuntimeException) {
			return (RuntimeException) e;
		}
		if (e instanceof InvocationTargetException) {
			// Extract subscriber method name to give developer more details
			String method = Log.getStackTraceString(e.getCause());
			int start = method.indexOf("at") + 3;
			method = method.substring(start, method.indexOf('\n', start));
			Log.e(TAG, "Exception in @Subscriber method: " + method + ". See stack trace for more details.");
		} 
		return new RuntimeException(e);		
	}
Example 25
public void withCause(Exception cause) {
    if (BuildConfig.DEBUG) {
      Log.println(priority, TAG, Log.getStackTraceString(cause));
    }
  }