当前位置: 首页>>代码示例>>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;未经允许,请勿转载。