Java Code Examples for android.util.Log.INFO
The following are Jave code examples for showing how to use
INFO 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: FinalProject File: LogMessageHelper.java View Source Code | 6 votes |
public static String prefixForPriority(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(" + priority + ")] "; } }
Example 2
Project: RxShell File: JUnitTree.java View Source Code | 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 3
Project: XFrame File: LoggerPrinter.java View Source Code | 6 votes |
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; } }
Example 4
Project: fast_face_android File: DebugLogFileTree.java View Source Code | 6 votes |
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 ""; }
Example 5
Project: javaide File: LogLineAdapterUtil.java View Source Code | 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 6
Project: superglue File: LumberYard.java View Source Code | 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 7
Project: javaide File: LogLine.java View Source Code | 6 votes |
private static int convertCharToLogLevel(char logLevelChar) { switch (logLevelChar) { case 'D': return Log.DEBUG; case 'E': return Log.ERROR; case 'I': return Log.INFO; case 'V': return Log.VERBOSE; case 'W': return Log.WARN; case 'F': return LogLineAdapterUtil.LOG_WTF; // 'F' actually stands for 'WTF', which is a real Android log level in 2.2 } return -1; }
Example 8
Project: MyBlogPost File: Logger.java View Source Code | 6 votes |
private static void longLog(int mode, String tag, String message) { int maxLogSize = 1000; for (int i = 0; i <= message.length() / maxLogSize; i++) { int start = i * maxLogSize; int end = (i + 1) * maxLogSize; end = end > message.length() ? message.length() : end; if (mode == Log.DEBUG) { Log.d(TAG + tag, message.substring(start, end)); } else if (mode == Log.ERROR) { Log.e(TAG + tag, message.substring(start, end)); } else if (mode == Log.INFO) { Log.i(TAG + tag, message.substring(start, end)); } else if (mode == Log.WARN) { Log.w(TAG + tag, message.substring(start, end)); } } }
Example 9
Project: TMvpSimple File: LogUtils.java View Source Code | 5 votes |
/** * Send an {@link Log#INFO} log message. * * @param obj */ public static void i(Object obj) { if (Log.INFO > DEBUG_LEVEL) { String tag = getClassName(); String msg = obj != null ? obj.toString() : "obj == null"; Log.i(tag, msg); } }
Example 10
Project: GitHub File: SingleRequest.java View Source Code | 5 votes |
private void onLoadFailed(GlideException e, int maxLogLevel) { stateVerifier.throwIfRecycled(); int logLevel = glideContext.getLogLevel(); if (logLevel <= maxLogLevel) { Log.w(GLIDE_TAG, "Load failed for " + model + " with size [" + width + "x" + height + "]", e); if (logLevel <= Log.INFO) { e.logRootCauses(GLIDE_TAG); } } loadStatus = null; status = Status.FAILED; isCallingCallbacks = true; try { //TODO: what if this is a thumbnail request? if ((requestListener == null || !requestListener.onLoadFailed(e, model, target, isFirstReadyResource())) && (targetListener == null || !targetListener.onLoadFailed(e, model, target, isFirstReadyResource()))) { setErrorPlaceholder(); } } finally { isCallingCallbacks = false; } notifyLoadFailed(); }
Example 11
Project: mobile-store File: ShadowLog.java View Source Code | 5 votes |
@Implementation public static synchronized boolean isLoggable(String tag, int level) { if ((TextUtils.equals(tag, "CursorWindowStats") && level <= Log.INFO) || (TextUtils.equals(tag, "SQLiteCursor") && level <= Log.DEBUG)) { return false; } return org.robolectric.shadows.ShadowLog.isLoggable(tag, level); }
Example 12
Project: Quran File: RecordingLogTree.java View Source Code | 5 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"; default: return String.valueOf(priority); } }
Example 13
Project: browser File: LogUtil.java View Source Code | 5 votes |
private static void print(int mode, final String tag, String msg) { if (!isPrint) { return; } if (msg == null) { Log.e(tag, MSG); return; } switch (mode) { case Log.VERBOSE: Log.v(tag, msg); break; case Log.DEBUG: Log.d(tag, msg); break; case Log.INFO: Log.i(tag, msg); break; case Log.WARN: Log.w(tag, msg); break; case Log.ERROR: Log.e(tag, msg); break; default: Log.d(tag, msg); break; } }
Example 14
Project: youkes_browser File: LogUtil.java View Source Code | 5 votes |
private static void print(int mode, final String tag, String msg) { if (!isPrint) { return; } if (msg == null) { Log.e(tag, MSG); return; } switch (mode) { case Log.VERBOSE: Log.v(tag, msg); break; case Log.DEBUG: Log.d(tag, msg); break; case Log.INFO: Log.i(tag, msg); break; case Log.WARN: Log.w(tag, msg); break; case Log.ERROR: Log.e(tag, msg); break; default: Log.d(tag, msg); break; } }
Example 15
Project: MultipleDownload File: LogUtils.java View Source Code | 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 16
Project: publicProject File: CommonLog.java View Source Code | 4 votes |
public static void i(String tag, String msg) { if (LOG_LEVEL > Log.INFO) { Log.i(tag, msg); } }
Example 17
Project: timber-junit-rule File: TimberTestRule.java View Source Code | 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 18
Project: async-file-uploader File: Logger.java View Source Code | 4 votes |
/** * Send a {@link Log#INFO} message. * @param msg The message to be logged. */ public static void i(String msg) { if (UploadQueue.getLogLevel() <= Log.INFO) { Log.v(Constants.TAG, msg); } }
Example 19
Project: TMvpSimple File: LogUtils.java View Source Code | 2 votes |
/** * Send an {@link Log#INFO} 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 i(String tag, String msg) { if (Log.INFO > DEBUG_LEVEL) { Log.i(tag, msg); } }
Example 20
Project: TMvpSimple-master File: LogUtils.java View Source Code | 2 votes |
/** * Send an {@link Log#INFO} 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 i(String tag, String msg) { if (Log.INFO > DEBUG_LEVEL) { Log.i(tag, msg); } }