APISonar


android.util.Log.ASSERT

> android > util > Log > ASSERT
android APIs util APIs Log APIs ASSERT APIs

Example 1
public static void wtf(String msg) {
        if (enableLog(Log.ASSERT)) {
            sILogger.log(Log.ASSERT, sTag, msg, null);
        }
    }
Example 2
public void enableCurlLogging(String name, int level) {
        if (name == null) {
            throw new NullPointerException("name");
        }
        if (level < Log.VERBOSE || level > Log.ASSERT) {
            throw new IllegalArgumentException("Level is out of range ["
                + Log.VERBOSE + ".." + Log.ASSERT + "]");    
        }

        curlConfiguration = new LoggingConfiguration(name, level);
    }
Example 3
public void assertTrue(boolean value, @Nullable Object data, Object... options) {
        if (!value) {
            printf(Log.ASSERT, data, options);
            throw new ScriptException(new AssertionError(format(data, options)));
        }
    }
Example 4
private static void openFileLogger(Context context) {
        closeFileLogger();
        if (sFileLoggingLevel < Log.ASSERT) {
            sFileLogger = new FileLogger(TAG_DEBUG, createFileLogDirIfNeeded(context));
        }
    }
Example 5
protected static int wtf(String tag, String msg, Throwable throwable) {
    addLog(Log.ASSERT, tag, msg, throwable);
    if (wtfIsFatal) {
      throw new TerribleFailure(msg, throwable);
    }
    return 0;
  }
Example 6
public static void wtf(String tag, String message, int methodCount) {
        validateMethodCount(methodCount);
        log(Log.ASSERT, tag, message, methodCount);
    }
Example 7
public void wtf_wtfIsFatalIsSet_shouldThrowTerribleFailure() {
    ShadowLog.setWtfIsFatal(true);

    Throwable throwable = new Throwable();
    try {
      Log.wtf("tag", "msg", throwable);
      fail("TerribleFailure should be thrown");
    } catch (ShadowLog.TerribleFailure e) {
      // pass
    }
    assertLogged(Log.ASSERT, "tag", "msg", throwable);
  }
Example 8
public void infoIsDefaultLoggableLevel() throws Exception {
    PrintStream old = ShadowLog.stream;
    ShadowLog.stream = null;
    assertFalse(Log.isLoggable("FOO", Log.VERBOSE));
    assertFalse(Log.isLoggable("FOO", Log.DEBUG));

    assertTrue(Log.isLoggable("FOO", Log.INFO));
    assertTrue(Log.isLoggable("FOO", Log.WARN));
    assertTrue(Log.isLoggable("FOO", Log.ERROR));
    assertTrue(Log.isLoggable("FOO", Log.ASSERT));
    ShadowLog.stream = old;
  }