Java Code Examples for android.util.Log#wtf()

The following examples show how to use android.util.Log#wtf() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
@Override
public void onReceive(Context context, Intent intent) {
    Log.d(TAG, intent.toString());
    if (!mIsAwaitingBroadcast.get())
        return;

    String installedPackage;
    try {
        installedPackage = intent.getDataString().replace("package:", "");
        String installerPackage = getContext().getPackageManager().getInstallerPackageName(installedPackage);
        Log.d(TAG, "installerPackage=" + installerPackage);
        if (!BuildConfig.APPLICATION_ID.equals(installerPackage))
            return;
    } catch (Exception e) {
        Log.wtf(TAG, e);
        return;
    }

    mIsAwaitingBroadcast.set(false);
    dispatchCurrentSessionUpdate(InstallationStatus.INSTALLATION_SUCCEED, installedPackage);
    installationCompleted();
}
 
Example 2
private void writeEvent(long eventTimeMs, int eventType, NotificationRecord r) {
    ContentValues cv = new ContentValues();
    cv.put(COL_EVENT_USER_ID, r.sbn.getUser().getIdentifier());
    cv.put(COL_EVENT_TIME, eventTimeMs);
    cv.put(COL_EVENT_TYPE, eventType);
    putNotificationIdentifiers(r, cv);
    if (eventType == EVENT_TYPE_POST) {
        putNotificationDetails(r, cv);
    } else {
        putPosttimeVisibility(r, cv);
    }
    SQLiteDatabase db = mHelper.getWritableDatabase();
    if (db.insert(TAB_LOG, null, cv) < 0) {
        Log.wtf(TAG, "Error while trying to insert values: " + cv);
    }
    sNumWrites++;
    pruneIfNecessary(db);
}
 
Example 3
private void setSurfaceFlingerTranslate(int x, int y)
{
	try
	{
		if (flinger == null) flinger = ServiceManager.getService("SurfaceFlinger");
		if (flinger == null)
		{
			Log.wtf(TAG, "SurfaceFlinger is null");
			return;
		}

		Parcel data = Parcel.obtain();
		data.writeInterfaceToken("android.ui.ISurfaceComposer");
		data.writeInt(x);
		data.writeInt(y);
		flinger.transact(2020, data, null, 0);
		data.recycle();
	}
	catch(Exception e)
	{
		Log.e(TAG, "SurfaceFlinger error", e);
	}
}
 
Example 4
Source Project: VideoProcessor   File: CL.java    License: Apache License 2.0 5 votes vote down vote up
public static void wtf(String message, Object... args) {
    if(sLogEnable) {
        CL.TagInfo tagInfo = getMethodNames((new Throwable()).getStackTrace());
        String msg = createLogWithoutFileName(tagInfo, message, args);
        Log.wtf(tagInfo.fileName, msg);
    }

}
 
Example 5
Source Project: DevUtils   File: LogPrintUtils.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 最终打印日志方法 ( 全部调用此方法 )
 * @param logType 日志类型
 * @param tag     打印 Tag
 * @param message 日志信息
 */
private static void printLog(final int logType, final String tag, final String message) {
    // 防止 null 处理
    if (message == null) return;
    // 获取日志类型
    switch (logType) {
        case Log.ERROR:
            Log.e(tag, message);
            break;
        case Log.INFO:
            Log.i(tag, message);
            break;
        case Log.VERBOSE:
            Log.v(tag, message);
            break;
        case Log.WARN:
            Log.w(tag, message);
            break;
        case Log.ASSERT:
            Log.wtf(tag, message);
            break;
        case Log.DEBUG:
            Log.d(tag, message);
            break;
        default:
            Log.d(tag, message);
            break;
    }
}
 
Example 6
@Override
public void run() {
    final byte[] temp = new byte[8192];
    try {
        while (read(mServer, temp, 0, MSG_LENGTH) == MSG_LENGTH) {
            final int cmd = FileUtils.peekInt(temp, 0, ByteOrder.BIG_ENDIAN);
            if (cmd == CMD_WRITE) {
                // Shuttle data into local file
                int len = FileUtils.peekInt(temp, 4, ByteOrder.BIG_ENDIAN);
                while (len > 0) {
                    int n = read(mServer, temp, 0, Math.min(temp.length, len));
                    if (n == -1) {
                        throw new IOException(
                                "Unexpected EOF; still expected " + len + " bytes");
                    }
                    write(mTarget, temp, 0, n);
                    len -= n;
                }

            } else if (cmd == CMD_FSYNC) {
                // Sync and echo back to confirm
                Os.fsync(mTarget);
                write(mServer, temp, 0, MSG_LENGTH);

            } else if (cmd == CMD_CLOSE) {
                // Close and echo back to confirm
                Os.fsync(mTarget);
                Os.close(mTarget);
                mClosed = true;
                write(mServer, temp, 0, MSG_LENGTH);
                break;
            }
        }

    } catch (ErrnoException | IOException e) {
        Log.wtf(TAG, "Failed during bridge", e);
    } finally {
        forceClose();
    }
}
 
Example 7
@Override
@BinderThread
public void start(Bundle invocationData, IJobCallback callback) {
  JobInvocation.Builder invocation = getJobCoder().decode(invocationData);
  if (invocation == null) {
    Log.wtf(TAG, "start: unknown invocation provided");
    return;
  }

  JobService.this.handleStartJobRequest(invocation.build(), callback);
}
 
Example 8
Source Project: xDrip-plus   File: JoH.java    License: GNU General Public License v3.0 5 votes vote down vote up
public static synchronized MediaPlayer playSoundUri(String soundUri) {
    try {
        JoH.getWakeLock("joh-playsound", 10000);
        final MediaPlayer player = MediaPlayer.create(xdrip.getAppContext(), Uri.parse(soundUri));
        player.setLooping(false);
        player.start();
        return player;
    } catch (Exception e) {
        Log.wtf(TAG, "Failed to play audio: " + soundUri + " exception:" + e);
        return null;
    }
}
 
Example 9
public ShareRest(Context context, OkHttpClient okHttpClient) {

        try {
            OkHttpClient httpClient = okHttpClient != null ? okHttpClient : getOkHttpClient();

            if (httpClient == null) httpClient = getOkHttpClient(); // try again on failure
            // if fails second time we've got big problems

            sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
            Gson gson = new GsonBuilder()
                    .excludeFieldsWithoutExposeAnnotation()
                    .create();
            Retrofit retrofit = new Retrofit.Builder()
                    .baseUrl(sharedPreferences.getBoolean("dex_share_us_acct", true) ? US_SHARE_BASE_URL : NON_US_SHARE_BASE_URL)
                    .client(httpClient)
                    .addConverterFactory(GsonConverterFactory.create(gson))
                    .build();
            dexcomShareApi = retrofit.create(DexcomShare.class);
            sessionId = sharedPreferences.getString("dexcom_share_session_id", null);
            username = sharedPreferences.getString("dexcom_account_name", null);
            password = sharedPreferences.getString("dexcom_account_password", null);
            serialNumber = sharedPreferences.getString("share_key", null);
            if (sharedPreferences.getBoolean("engineering_mode", false)) {
                final String share_test_key = sharedPreferences.getString("share_test_key", "").trim();
                if (share_test_key.length() > 4) serialNumber = share_test_key;
            }
            sharedPreferences.registerOnSharedPreferenceChangeListener(preferenceChangeListener);
            if ("".equals(sessionId)) // migrate previous empty sessionIds to null;
                sessionId = null;
        } catch (IllegalStateException e) {
            Log.wtf(TAG, "Illegal state exception: " + e);
        }
    }
 
Example 10
Source Project: lrkFM   File: ArchiveExtractionTask.java    License: MIT License 5 votes vote down vote up
/**
 * Extracts the archive.
 * @param args the void args (unused)
 * @return true if successful.
 * @see ArchiveUtil#doExtractArchive(String, FMFile)
 */
@Override
protected Boolean doInBackground(final Void... args) {
    try {
        return new ArchiveUtil().doExtractArchive(destinationPath, archive);
    } catch (BlockingStuffOnMainThreadException e) {
        Log.wtf(TAG, "This should not happen here!", e);
        return false;
    }
}
 
Example 11
public static void wtf(String tag, String msg) {
    if (BuildConfig.DEBUG) {
        Log.wtf(tag, msg);
    }
}
 
Example 12
Source Project: httplite   File: LogUtil.java    License: Apache License 2.0 4 votes vote down vote up
public static void wtf(String content, Throwable tr) {
    if (!isDebug) return;
    String tag = generateTag();

    Log.wtf(tag, content, tr);
}
 
Example 13
Source Project: SaveVolley   File: VolleyLog.java    License: Apache License 2.0 4 votes vote down vote up
public static void wtf(Throwable tr, String format, Object... args) {
    Log.wtf(TAG, buildMessage(format, args), tr);
}
 
Example 14
Source Project: pre-dem-android   File: DEMImpl.java    License: MIT License 4 votes vote down vote up
public void wtf(String tag, Throwable tr) {
    Log.wtf(tag, tr);
    if (level < W) {
        PrintLogger.getInstance(context.get()).Log(tag, getStackTraceString("", tr));
    }
}
 
Example 15
int wtf(String tag, Throwable tr) {
    if (enableLogging && logLevel <= Log.ASSERT) return Log.wtf(tag, tr);
    return 0;
}
 
Example 16
Source Project: pearl   File: VolleyLog.java    License: Apache License 2.0 4 votes vote down vote up
public static void wtf(String format, Object... args) {
    Log.wtf(TAG, buildMessage(format, args));
}
 
Example 17
int wtf(String tag, String msg) {
    if (enableLogging && logLevel <= Log.ASSERT) return Log.wtf(tag, msg);
    return 0;
}
 
Example 18
public static void wtf(String TAG, String message) {
    if (mDebug) {
        Log.wtf(TAG, message);
    }
}
 
Example 19
public static void wtf(String tag, String text) {
	if (BuildConfig.DEBUG)
		Log.wtf(tag, text);
}
 
Example 20
/**
 * Send a FATAL ERROR log message
 *
 * @param tag
 * @param msg
 * @param throwable
 */
public static void f(String tag, String msg, Throwable throwable) {
    if (sLevel > LEVEL_FATAL) {
        return;
    }
    Log.wtf(tag, msg, throwable);
}