Java Code Examples for android.util.Log.VERBOSE

The following are Jave code examples for showing how to use VERBOSE of the android.util.Log class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: javaide   File: LogLineAdapterUtil.java   View Source Code Vote up 6 votes
public static int getBackgroundColorForLogLevel(Context context, int logLevel) {
    int result = android.R.color.black;
    switch (logLevel) {
        case Log.DEBUG:
            result = R.color.background_debug;
            break;
        case Log.ERROR:
            result = R.color.background_error;
            break;
        case Log.INFO:
            result = R.color.background_info;
            break;
        case Log.VERBOSE:
            result = R.color.background_verbose;
            break;
        case Log.WARN:
            result = R.color.background_warn;
            break;
        case LOG_WTF:
            result = R.color.background_wtf;
            break;
    }

    return ContextCompat.getColor(context,result);
}
 
Example 2
Project: superglue   File: LumberYard.java   View Source Code Vote up 6 votes
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 "?";
  }
}
 
Example 3
Project: DebugOverlay-Android   File: TimberDataModule.java   View Source Code Vote up 6 votes
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;
    }
}
 
Example 4
Project: javaide   File: LogLineAdapterUtil.java   View Source Code Vote up 6 votes
public static int getForegroundColorForLogLevel(Context context, int logLevel) {
    int result = android.R.color.primary_text_dark;
    switch (logLevel) {
        case Log.DEBUG:
            result = R.color.foreground_debug;
            break;
        case Log.ERROR:
            result = R.color.foreground_error;
            break;
        case Log.INFO:
            result = R.color.foreground_info;
            break;
        case Log.VERBOSE:
            result = R.color.foreground_verbose;
            break;
        case Log.WARN:
            result = R.color.foreground_warn;
            break;
        case LOG_WTF:
            result = R.color.foreground_wtf;
            break;
    }
    return ContextCompat.getColor(context,result);
}
 
Example 5
Project: RxShell   File: JUnitTree.java   View Source Code Vote up 6 votes
private static String priorityToString(int priority) {
    switch (priority) {
        case Log.ERROR:
            return "E";
        case Log.WARN:
            return "W";
        case Log.INFO:
            return "I";
        case Log.DEBUG:
            return "D";
        case Log.VERBOSE:
            return "V";
        default:
            return String.valueOf(priority);
    }
}
 
Example 6
Project: redux-observable   File: App.java   View Source Code Vote up 6 votes
@Override
protected void log(int priority, String tag, String message, Throwable t) {
    if (priority == Log.VERBOSE || priority == Log.DEBUG) {
        return;
    }

    Log.println(priority, tag, message);

    if (t != null) {
        if (priority == Log.ERROR) {
            Log.e(tag, message, t);
        } else if (priority == Log.WARN) {
            Log.w(tag, message, t);
        }
    }
}
 
Example 7
Project: javaide   File: LogLine.java   View Source Code Vote up 6 votes
private static char convertLogLevelToChar(int logLevel) {

        switch (logLevel) {
            case Log.DEBUG:
                return 'D';
            case Log.ERROR:
                return 'E';
            case Log.INFO:
                return 'I';
            case Log.VERBOSE:
                return 'V';
            case Log.WARN:
                return 'W';
            case LogLineAdapterUtil.LOG_WTF:
                return 'F';
        }
        return ' ';
    }
 
Example 8
Project: superglue   File: LogAdapter.java   View Source Code Vote up 6 votes
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;
  }
}
 
Example 9
Project: Phial   File: PhialLogger.java   View Source Code Vote up 6 votes
/**
 * Create new log entry in file.
 * <p>
 * You should not call it directly from your application build some facade (or use Timber) and set it to write to
 * PhialLogger.
 *
 * @param priority Log level. See {@link Log} for constants.
 * @param tag      Explicit or inferred tag. May be {@code null}.
 * @param message  Formatted log message. May be {@code null}.
 * @param t        Accompanying exceptions. May be {@code null}.
 */
public void log(int priority, String tag, String message, Throwable t) {
    final org.slf4j.Logger logger = LoggerFactory.getLogger(tag);

    switch (priority) {
        case Log.VERBOSE:
            logger.trace(message, t);
            break;
        case Log.DEBUG:
            logger.debug(message, t);
            break;
        case Log.INFO:
            logger.info(message, t);
            break;
        case Log.WARN:
            logger.warn(message, t);
            break;
        case Log.ERROR:
            logger.error(message, t);
            break;
        default:
            logger.error("unexpected Log priority: " + priority + " " + message, t);
            break;
    }
}
 
Example 10
Project: historian   File: Util.java   View Source Code Vote up 6 votes
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";
  }
}
 
Example 11
Project: AndroidBlueprints   File: MyApplication.java   View Source Code Vote up 6 votes
@Override
protected void log(int priority, String tag, String message, Throwable throwable) {
    if (priority == Log.VERBOSE || priority == Log.DEBUG) {
        return;
    }

    FakeCrashLibrary.log(priority, tag, message);

    if (throwable != null) {
        if (priority == Log.ERROR) {
            FakeCrashLibrary.logError(throwable);
        } else if (priority == Log.WARN) {
            FakeCrashLibrary.logWarning(throwable);
        }
    }
}
 
Example 12
Project: TMvpSimple-master   File: LogUtils.java   View Source Code Vote up 5 votes
/**
 * Print the array of stack trace elements of this method in black.
 *
 * @return
 */
public static void printCallHierarchy() {
    if (Log.VERBOSE > DEBUG_LEVEL) {
        String tag = getClassName();
        String method = callMethodAndLine();
        String hierarchy = getCallHierarchy();
        Log.v(tag, method + hierarchy);
        if (DEBUG_SYSOUT) {
            System.out.println(tag + "  " + method + hierarchy);
        }
    }
}
 
Example 13
Project: TMvpSimple-master   File: LogUtils.java   View Source Code Vote up 5 votes
/**
 * Send a {@link Log#VERBOSE} log message.
 *
 * @param obj
 */
public static void v(Object obj) {
    if (Log.VERBOSE > DEBUG_LEVEL) {
        String tag = getClassName();
        String msg = obj != null ? obj.toString() : "obj == null";
        Log.v(tag, msg);
    }
}
 
Example 14
Project: TMvpSimple   File: LogUtils.java   View Source Code Vote up 5 votes
/**
 * Send a {@link Log#VERBOSE} log message.
 *
 * @param obj
 */
public static void v(Object obj) {
    if (Log.VERBOSE > DEBUG_LEVEL) {
        String tag = getClassName();
        String msg = obj != null ? obj.toString() : "obj == null";
        Log.v(tag, msg);
    }
}
 
Example 15
Project: fast_face_android   File: DlibDemoApp.java   View Source Code Vote up 5 votes
@Override
protected void log(int priority, String tag, String message, Throwable t) {
    if (priority == Log.VERBOSE || priority == Log.DEBUG) {
        return;
    }
    super.log(priority, tag, message, t);
}
 
Example 16
Project: okuki   File: App.java   View Source Code Vote up 5 votes
@Override
protected void log(int priority, String tag, String message, Throwable t) {
    if (priority == Log.VERBOSE || priority == Log.DEBUG) {
        return;
    }

    //TODO Log to crash reporting
    if (t != null) {
        if (priority == Log.ERROR) {
            //TODO Log throwable as error to crash reporting
        } else if (priority == Log.WARN) {
            //TODO Log throwable as warning to crash reporting
        }
    }
}
 
Example 17
Project: Dalaran   File: LogUtils.java   View Source Code Vote up 5 votes
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();
        }
    }
 
Example 18
Project: MultipleDownload   File: LogUtils.java   View Source Code Vote up 4 votes
public static void log(String tag, int level, String msg, Throwable tr) {
    if (isLog) {
        switch (level) {
            case Log.VERBOSE:
                if (tr == null) {
                    Log.v(tag, msg);
                } else {
                    Log.v(tag, msg, tr);
                }
                break;
            case Log.INFO:
                if (tr == null) {
                    Log.i(tag, msg);
                } else {
                    Log.i(tag, msg, tr);
                }
                break;
            case Log.DEBUG:
                if (tr == null) {
                    Log.d(tag, msg);
                } else {
                    Log.d(tag, msg, tr);
                }
                break;
            case Log.WARN:
                if (tr == null) {
                    Log.w(tag, msg);
                } else {
                    Log.w(tag, msg, tr);
                }
                break;
            case Log.ERROR:
                if (tr == null) {
                    Log.e(tag, msg, tr);
                } else {
                    Log.e(tag, msg, tr);
                }

                break;
        }
    }

}
 
Example 19
Project: timber-junit-rule   File: TimberTestRule.java   View Source Code Vote up 4 votes
/**
 * Creates a log message based on the rules and Timber log details.
 *
 * @param rules    the rules used to construct the message.
 * @param priority the priority of the log.
 * @param tag      the tag of the log.
 * @param message  the message of the log.
 * @return a log message (may be null).
 */
private static String createLogMessage(Rules rules, int priority, String tag, String message) {
    // Avoid logging if the priority is too low.
    if (priority < rules.mMinPriority) {
        return null;
    }

    // Obtain the correct log type prefix.
    final char type;
    switch (priority) {
        case Log.VERBOSE:
            type = 'V';
            break;

        case Log.DEBUG:
            type = 'D';
            break;

        case Log.INFO:
            type = 'I';
            break;

        case Log.WARN:
            type = 'W';
            break;

        case Log.ERROR:
        default:
            type = 'E';
            break;
    }

    StringBuilder logBuilder = new StringBuilder();

    if (rules.mShowTimestamp) {
        logBuilder
                .append(THREAD_LOCAL_FORMAT.get().format(System.currentTimeMillis()))
                .append(" ");
    }

    if (rules.mShowThread) {
        Thread thread = Thread.currentThread();
        logBuilder
                .append(thread.getId())
                .append("/")
                .append(thread.getName())
                .append(" ");
    }

    logBuilder
            .append(type)
            .append("/")
            .append(tag)
            .append(": ")
            .append(message);

    return logBuilder.toString();
}
 
Example 20
Project: TMvpSimple-master   File: LogUtils.java   View Source Code Vote up 2 votes
/**
 * Send a {@link Log#VERBOSE} log message.
 *
 * @param tag Used to identify the source of a log message. It usually
 *            identifies the class or activity where the log call occurs.
 * @param msg The message you would like logged.
 */
public static void v(String tag, String msg) {
    if (Log.VERBOSE > DEBUG_LEVEL) {
        Log.v(tag, msg);
    }
}