本文整理汇总了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;
}
}
示例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 "";
}
示例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";
}
}
示例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;
}
}
示例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 "?";
}
}
示例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;
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
}
示例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();
}
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}