當前位置: 首頁>>代碼示例>>Java>>正文


Java Log.ASSERT屬性代碼示例

本文整理匯總了Java中android.util.Log.ASSERT屬性的典型用法代碼示例。如果您正苦於以下問題:Java Log.ASSERT屬性的具體用法?Java Log.ASSERT怎麽用?Java Log.ASSERT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.util.Log的用法示例。


在下文中一共展示了Log.ASSERT屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getLogcatLinePriority

private static LogcatLine.Priority getLogcatLinePriority(int priority) {
    if (Log.VERBOSE == priority) {
        return LogcatLine.Priority.VERBOSE;
    } else if (Log.DEBUG == priority) {
        return LogcatLine.Priority.DEBUG;
    } else if (Log.INFO == priority) {
        return LogcatLine.Priority.INFO;
    } else if (Log.WARN == priority) {
        return LogcatLine.Priority.WARNING;
    } else if (Log.ERROR == priority) {
        return LogcatLine.Priority.ERROR;
    } else if (Log.ASSERT == priority) {
        return LogcatLine.Priority.ASSERT;
    } else {
        return LogcatLine.Priority.SILENT;
    }
}
 
開發者ID:Manabu-GT,項目名稱:DebugOverlay-Android,代碼行數:17,代碼來源:TimberDataModule.java

示例2: getPriorityString

public String getPriorityString(int priority) {
    if (priority == Log.ASSERT) {
        return "A";
    } else if (priority == Log.ERROR) {
        return "E";
    } else if (priority == Log.WARN) {
        return "W";
    } else if (priority == Log.INFO) {
        return "I";
    } else if (priority == Log.DEBUG) {
        return "D";
    } else if (priority == Log.VERBOSE) {
        return "V";
    }
    return "";
}
 
開發者ID:gicheonkang,項目名稱:fast_face_android,代碼行數:16,代碼來源:DebugLogFileTree.java

示例3: priorityString

public static String priorityString(int priority) {
  switch (priority) {
    case Log.VERBOSE:
      return "VERBOSE";
    case Log.DEBUG:
      return "DEBUG";
    case Log.INFO:
      return "INFO";
    case Log.WARN:
      return "WARN";
    case Log.ERROR:
      return "ERROR";
    case Log.ASSERT:
      return "ASSERT";
    default:
      return "UNKNOWN";
  }
}
 
開發者ID:yshrsmz,項目名稱:historian,代碼行數:18,代碼來源:Util.java

示例4: logChunk

private void logChunk(int priority, String chunk) {
    logStr.append(LINE_SEPARATOR);
    logStr.append(chunk);
    String TAG = config.getTag();
    switch (priority) {
        case Log.ERROR:
            Log.e(TAG, chunk);
            break;
        case Log.INFO:
            Log.i(TAG, chunk);
            break;
        case Log.VERBOSE:
            Log.v(TAG, chunk);
            break;
        case Log.WARN:
            Log.w(TAG, chunk);
            break;
        case Log.ASSERT:
            Log.wtf(TAG, chunk);
            break;
        case Log.DEBUG:
        default:
            Log.d(TAG, chunk);
            break;
    }
}
 
開發者ID:youth5201314,項目名稱:XFrame,代碼行數:26,代碼來源:LoggerPrinter.java

示例5: displayLevel

public String displayLevel() {
  switch (level) {
    case Log.VERBOSE:
      return "V";
    case Log.DEBUG:
      return "D";
    case Log.INFO:
      return "I";
    case Log.WARN:
      return "W";
    case Log.ERROR:
      return "E";
    case Log.ASSERT:
      return "A";
    default:
      return "?";
  }
}
 
開發者ID:rogues-dev,項目名稱:superglue,代碼行數:18,代碼來源:LumberYard.java

示例6: backgroundForLevel

public static @DrawableRes int backgroundForLevel(int level) {
  switch (level) {
    case Log.VERBOSE:
    case Log.DEBUG:
      return R.color.debug_log_accent_debug;
    case Log.INFO:
      return R.color.debug_log_accent_info;
    case Log.WARN:
      return R.color.debug_log_accent_warn;
    case Log.ERROR:
    case Log.ASSERT:
      return R.color.debug_log_accent_error;
    default:
      return R.color.debug_log_accent_unknown;
  }
}
 
開發者ID:rogues-dev,項目名稱:superglue,代碼行數:16,代碼來源:LogAdapter.java

示例7: log

/**
 * Break up {@code message} into maximum-length chunks (if needed) and send to either
 * {@link Log#println(int, String, String) Log.println()} or
 * {@link Log#wtf(String, String) Log.wtf()} for logging.
 *
 * {@inheritDoc}
 */
@Override protected void log(int priority, String tag, @NotNull String message, Throwable t) {
  if (message.length() < MAX_LOG_LENGTH) {
    if (priority == Log.ASSERT) {
      Log.wtf(tag, message);
    } else {
      Log.println(priority, tag, message);
    }
    return;
  }

  // Split by line, then ensure each line can fit into Log's maximum length.
  for (int i = 0, length = message.length(); i < length; i++) {
    int newline = message.indexOf('\n', i);
    newline = newline != -1 ? newline : length;
    do {
      int end = Math.min(newline, i + MAX_LOG_LENGTH);
      String part = message.substring(i, end);
      if (priority == Log.ASSERT) {
        Log.wtf(tag, part);
      } else {
        Log.println(priority, tag, part);
      }
      i = end;
    } while (i < newline);
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:33,代碼來源:Timber.java

示例8: log

@Override
protected void log(int priority, String tag, String message, Throwable t) {
    if(isLoggable(tag,priority)){

        if(priority == Log.ERROR && t!=null){
            //Send the log to your crashlatics framework
        }

        if(message.length() < MAX_LOG_LENGTH){
            if(priority == Log.ASSERT){
                Log.wtf(tag,message);
            }else {
                Log.println(priority,tag,message);
            }
            return;
        }
    }

    for (int i = 0, length = message.length(); i < length; i++) {
        int newline = message.indexOf('\n', i);
        newline = newline != -1 ? newline : length;
        do {
            int end = Math.min(newline, i + MAX_LOG_LENGTH);
            String part = message.substring(i, end);
            if (priority == Log.ASSERT) {
                Log.wtf(tag, part);
            } else {
                Log.println(priority, tag, part);
            }
            i = end;
        } while (i < newline);
    }

}
 
開發者ID:iamBedant,項目名稱:InstantAppStarter,代碼行數:34,代碼來源:ReleaseTree.java

示例9: log

@Override protected void log(int priority, String tag, String message, Throwable t) {
  if (isLoggable(tag, priority)) {

    // Report caught exceptions to Crashlytics
    if (priority == Log.ERROR && t != null) {
      //Crashlytics.log(t);
    }

    // Message is short emough, does not need to be broken into chunks
    if (message.length() < MAX_LOG_LENGTH) {
      if (priority == Log.ASSERT) {
        Log.wtf(tag, message);
      } else {
        Log.println(priority, tag, message);
      }
      return;
    }

    for (int i = 0, length = message.length(); i < length; i++) {
      int newLine = message.indexOf('\n', i);
      newLine = newLine != -1 ? newLine : length;
      do {
        int end = Math.min(newLine, i + MAX_LOG_LENGTH);
        String part = message.substring(i, end);
        if (priority == Log.ASSERT) {
          Log.wtf(tag, part);
        } else {
          Log.println(priority, tag, part);
        }
        i = end;
      } while (i < newLine);
    }
  }
}
 
開發者ID:WassimBenltaief,項目名稱:TodoMvp,代碼行數:34,代碼來源:ReleaseTree.java

示例10: log

@Override
protected void log(int priority, String tag, String message, Throwable t) {
    if (message.length() < MAX_LOG_LENGTH) {
        if (priority == Log.ASSERT) {
            Log.wtf(tag, message);
        } else {
            Log.println(priority, tag, message);
        }
        return;
    }

    // Split by line, then ensure each line can fit into Log's maximum length.
    for (int i = 0, length = message.length(); i < length; i++) {
        int newline = message.indexOf('\n', i);
        newline = newline != -1 ? newline : length;
        do {
            int end = Math.min(newline, i + MAX_LOG_LENGTH);
            String part = message.substring(i, end);
            if (priority == Log.ASSERT) {
                Log.wtf(tag, part);
            } else {
                Log.println(priority, tag, part);
            }
            i = end;
        } while (i < newline);
    }
}
 
開發者ID:aprochukhan,項目名稱:Android-MVVM-Example,代碼行數:27,代碼來源:ReleaseTree.java

示例11: log

private static void log(int level, Object o, Throwable tr) {
        if (!ENABLED) return;

        String trace = generateTrace();
        String toast = trace.split("\\(")[0];
        String message = generateMessage(o) + SEPARATOR + trace;

        if (tr != null) {
            message += "\n" + Log.getStackTraceString(tr);
        }

        switch (level) {
            case Log.VERBOSE:
                Log.v(TAG, message);
                break;
            case Log.DEBUG:
                Log.d(TAG, message);
                break;
            case Log.INFO:
                Log.i(TAG, message);
                break;
            case Log.WARN:
                Log.w(TAG, message);
//                ToastManager.show("Log.WARN\n" + toast);
                break;
            case Log.ERROR:
                Log.e(TAG, message);
//                ToastManager.show("Log.ERROR\n" + toast);
//                throw new IllegalStateException(message);
                break;
            case Log.ASSERT:
                Log.wtf(TAG, message);
//                ToastManager.show("Log.ASSERT\n" + toast);
//                throw new IllegalStateException(message);
                break;
            default:
                throw new IllegalStateException();
        }
    }
 
開發者ID:killnono,項目名稱:Dalaran,代碼行數:39,代碼來源:LogUtils.java

示例12: log

/**
 * Break up {@code message} into maximum-length chunks (if needed) and send to either
 * {@link Log#println(int, String, String) Log.println()} or
 * {@link Log#wtf(String, String) Log.wtf()} for logging.
 * <p>
 * {@inheritDoc}
 */
@Override
protected void log(int priority, String tag, String message, Throwable t) {
    if (message.length() < MAX_LOG_LENGTH) {
        if (priority == Log.ASSERT) {
            Log.wtf(tag, message);
        } else {
            Log.println(priority, tag, message);
        }
        return;
    }

    // Split by line, then ensure each line can fit into Log's maximum length.
    for (int i = 0, length = message.length(); i < length; i++) {
        int newline = message.indexOf('\n', i);
        newline = newline != -1 ? newline : length;
        do {
            int end = Math.min(newline, i + MAX_LOG_LENGTH);
            String part = message.substring(i, end);
            if (priority == Log.ASSERT) {
                Log.wtf(tag, part);
            } else {
                Log.println(priority, tag, part);
            }
            i = end;
        } while (i < newline);
    }
}
 
開發者ID:davidwhitman,項目名稱:Tir,代碼行數:34,代碼來源:Timber.java

示例13: showLog

private static void showLog(int priority, String tag, String message) {
    if (isLoggable && logLevel <= priority) {
        if (priority == Log.ASSERT) {
            Log.wtf(tag, message);
        } else {
            Log.println(priority, tag, message);
        }
    }
}
 
開發者ID:JarvanMo,項目名稱:CommonLibrary,代碼行數:9,代碼來源:MLog.java

示例14: log

@Override
protected void log(int priority, String tag, String message, Throwable t) {
    if (isLoggable(priority)) {
        // Message is short enough, does not need to be broken into chunks
        if (message.length() < MAX_LOG_LENGTH) {
            if (priority == Log.ASSERT) {
                Log.wtf(tag, message);
            } else {
                Log.println(priority, tag, message);
            }
            return;
        }

        // Split by line, then ensure each line can fit into Log's maximum length
        for (int i = 0, length = message.length(); i < length; i++) {
            int newline = message.indexOf('\n', i);
            newline = newline != -1 ? newline : length;
            do {
                int end = Math.min(newline, i + MAX_LOG_LENGTH);
                String part = message.substring(i, end);
                if (priority == Log.ASSERT) {
                    Log.wtf(tag, part);
                } else {
                    Log.println(priority, tag, part);
                }
                i = end;
            } while (i < newline);
        }
    }
}
 
開發者ID:SalmanTKhan,項目名稱:MyAnimeViewer,代碼行數:30,代碼來源:MAVApplication.java

示例15: enableCurlLogging

/**
 * Enables cURL request logging for this client.
 *
 * @param name to log messages with
 * @param level at which to log messages (see {@link android.util.Log})
 */
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);
}
 
開發者ID:SlotNSlot,項目名稱:SlotNSlot_Android,代碼行數:17,代碼來源:AndroidHttpClient.java


注:本文中的android.util.Log.ASSERT屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。