Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2638)

Unified Diff: android/java/src/org/chromium/base/Log.java

Issue 2050803003: Update to Chromium //base at Chromium commit e3a753f17bac62738b0dbf0b36510f767b081e4b. (Closed) Base URL: https://github.com/domokit/base.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: android/java/src/org/chromium/base/Log.java
diff --git a/android/java/src/org/chromium/base/Log.java b/android/java/src/org/chromium/base/Log.java
index 3b46cdcd65f61e6bf317475bd0dfc41ab3106398..2a7721163d6f80e072b750a716b3aa4230b6b654 100644
--- a/android/java/src/org/chromium/base/Log.java
+++ b/android/java/src/org/chromium/base/Log.java
@@ -17,7 +17,7 @@ import java.util.Locale;
* the origin of logs, and enable or disable logging in different parts of the code.
* </p>
* <p>
- * @see usage documentation: <a href="README_logging.md">README_logging.md</a>.
+ * Usage documentation: {@code //docs/logging.md}.
* </p>
*/
public class Log {
@@ -60,7 +60,12 @@ public class Log {
return "[" + getCallOrigin() + "] " + formatLog(messageTemplate, params);
}
- /** Convenience function, forwards to {@link android.util.Log#isLoggable(String, int)}. */
+ /**
+ * Convenience function, forwards to {@link android.util.Log#isLoggable(String, int)}.
+ *
+ * Note: Has no effect on whether logs are sent or not. Use a method with
+ * {@link RemovableInRelease} to log something in Debug builds only.
+ */
public static boolean isLoggable(String tag, int level) {
return android.util.Log.isLoggable(tag, level);
}
@@ -79,14 +84,12 @@ public class Log {
* one is a {@link Throwable}, its trace will be printed.
*/
private static void verbose(String tag, String messageTemplate, Object... args) {
- if (Log.isLoggable(tag, Log.VERBOSE)) {
- String message = formatLogWithStack(messageTemplate, args);
- Throwable tr = getThrowableToLog(args);
- if (tr != null) {
- android.util.Log.v(tag, message, tr);
- } else {
- android.util.Log.v(tag, message);
- }
+ String message = formatLogWithStack(messageTemplate, args);
+ Throwable tr = getThrowableToLog(args);
+ if (tr != null) {
+ android.util.Log.v(tag, message, tr);
+ } else {
+ android.util.Log.v(tag, message);
}
}
@@ -165,14 +168,12 @@ public class Log {
* one is a {@link Throwable}, its trace will be printed.
*/
private static void debug(String tag, String messageTemplate, Object... args) {
- if (isLoggable(tag, Log.DEBUG)) {
- String message = formatLogWithStack(messageTemplate, args);
- Throwable tr = getThrowableToLog(args);
- if (tr != null) {
- android.util.Log.d(tag, message, tr);
- } else {
- android.util.Log.d(tag, message);
- }
+ String message = formatLogWithStack(messageTemplate, args);
+ Throwable tr = getThrowableToLog(args);
+ if (tr != null) {
+ android.util.Log.d(tag, message, tr);
+ } else {
+ android.util.Log.d(tag, message);
}
}
@@ -246,14 +247,12 @@ public class Log {
*/
@VisibleForTesting
public static void i(String tag, String messageTemplate, Object... args) {
- if (Log.isLoggable(tag, Log.INFO)) {
- String message = formatLog(messageTemplate, args);
- Throwable tr = getThrowableToLog(args);
- if (tr != null) {
- android.util.Log.i(tag, message, tr);
- } else {
- android.util.Log.i(tag, message);
- }
+ String message = formatLog(messageTemplate, args);
+ Throwable tr = getThrowableToLog(args);
+ if (tr != null) {
+ android.util.Log.i(tag, message, tr);
+ } else {
+ android.util.Log.i(tag, message);
}
}
@@ -268,14 +267,12 @@ public class Log {
*/
@VisibleForTesting
public static void w(String tag, String messageTemplate, Object... args) {
- if (Log.isLoggable(tag, Log.WARN)) {
- String message = formatLog(messageTemplate, args);
- Throwable tr = getThrowableToLog(args);
- if (tr != null) {
- android.util.Log.w(tag, message, tr);
- } else {
- android.util.Log.w(tag, message);
- }
+ String message = formatLog(messageTemplate, args);
+ Throwable tr = getThrowableToLog(args);
+ if (tr != null) {
+ android.util.Log.w(tag, message, tr);
+ } else {
+ android.util.Log.w(tag, message);
}
}
@@ -290,14 +287,12 @@ public class Log {
*/
@VisibleForTesting
public static void e(String tag, String messageTemplate, Object... args) {
- if (Log.isLoggable(tag, Log.ERROR)) {
- String message = formatLog(messageTemplate, args);
- Throwable tr = getThrowableToLog(args);
- if (tr != null) {
- android.util.Log.e(tag, message, tr);
- } else {
- android.util.Log.e(tag, message);
- }
+ String message = formatLog(messageTemplate, args);
+ Throwable tr = getThrowableToLog(args);
+ if (tr != null) {
+ android.util.Log.e(tag, message, tr);
+ } else {
+ android.util.Log.e(tag, message);
}
}
@@ -316,14 +311,12 @@ public class Log {
*/
@VisibleForTesting
public static void wtf(String tag, String messageTemplate, Object... args) {
- if (Log.isLoggable(tag, Log.ASSERT)) {
- String message = formatLog(messageTemplate, args);
- Throwable tr = getThrowableToLog(args);
- if (tr != null) {
- android.util.Log.wtf(tag, message, tr);
- } else {
- android.util.Log.wtf(tag, message);
- }
+ String message = formatLog(messageTemplate, args);
+ Throwable tr = getThrowableToLog(args);
+ if (tr != null) {
+ android.util.Log.wtf(tag, message, tr);
+ } else {
+ android.util.Log.wtf(tag, message);
}
}
« no previous file with comments | « android/java/src/org/chromium/base/BaseChromiumApplication.java ('k') | android/java/src/org/chromium/base/PathUtils.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698