Class Log
- java.lang.Object
-
- com.google.android.exoplayer2.util.Log
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceLog.LogLevelLog level for ExoPlayer logcat logging.
-
Field Summary
Fields Modifier and Type Field Description static intLOG_LEVEL_ALLLog level to log all messages.static intLOG_LEVEL_ERRORLog level to only log error messages.static intLOG_LEVEL_INFOLog level to only log informative, warning and error messages.static intLOG_LEVEL_OFFLog level to disable all logging.static intLOG_LEVEL_WARNINGLog level to only log warning and error messages.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidd(String tag, String message)static voidd(String tag, String message, Throwable throwable)static voide(String tag, String message)static voide(String tag, String message, Throwable throwable)static @com.google.android.exoplayer2.util.Log.LogLevel intgetLogLevel()Returns currentLog.LogLevelfor ExoPlayer logcat logging.static StringgetThrowableString(Throwable throwable)Returns a string representation of aThrowablesuitable for logging, taking into account whethersetLogStackTraces(boolean)stack trace logging} is enabled.static voidi(String tag, String message)static voidi(String tag, String message, Throwable throwable)static voidsetLogLevel(@com.google.android.exoplayer2.util.Log.LogLevel int logLevel)Sets theLog.LogLevelfor ExoPlayer logcat logging.static voidsetLogStackTraces(boolean logStackTraces)Sets whether stack traces ofThrowables will be logged to logcat.static voidw(String tag, String message)static voidw(String tag, String message, Throwable throwable)
-
-
-
Field Detail
-
LOG_LEVEL_ALL
public static final int LOG_LEVEL_ALL
Log level to log all messages.- See Also:
- Constant Field Values
-
LOG_LEVEL_INFO
public static final int LOG_LEVEL_INFO
Log level to only log informative, warning and error messages.- See Also:
- Constant Field Values
-
LOG_LEVEL_WARNING
public static final int LOG_LEVEL_WARNING
Log level to only log warning and error messages.- See Also:
- Constant Field Values
-
LOG_LEVEL_ERROR
public static final int LOG_LEVEL_ERROR
Log level to only log error messages.- See Also:
- Constant Field Values
-
LOG_LEVEL_OFF
public static final int LOG_LEVEL_OFF
Log level to disable all logging.- See Also:
- Constant Field Values
-
-
Method Detail
-
getLogLevel
@Pure public static @com.google.android.exoplayer2.util.Log.LogLevel int getLogLevel()
Returns currentLog.LogLevelfor ExoPlayer logcat logging.
-
setLogLevel
public static void setLogLevel(@com.google.android.exoplayer2.util.Log.LogLevel int logLevel)
Sets theLog.LogLevelfor ExoPlayer logcat logging.- Parameters:
logLevel- The newLog.LogLevel.
-
setLogStackTraces
public static void setLogStackTraces(boolean logStackTraces)
Sets whether stack traces ofThrowables will be logged to logcat. Stack trace logging is enabled by default.- Parameters:
logStackTraces- Whether stack traces will be logged.
-
d
@Pure public static void d(@Size(max=23L) String tag, String message)- See Also:
Log.d(String, String)
-
d
@Pure public static void d(@Size(max=23L) String tag, String message, @Nullable Throwable throwable)- See Also:
Log.d(String, String, Throwable)
-
i
@Pure public static void i(@Size(max=23L) String tag, String message)- See Also:
Log.i(String, String)
-
i
@Pure public static void i(@Size(max=23L) String tag, String message, @Nullable Throwable throwable)- See Also:
Log.i(String, String, Throwable)
-
w
@Pure public static void w(@Size(max=23L) String tag, String message)- See Also:
Log.w(String, String)
-
w
@Pure public static void w(@Size(max=23L) String tag, String message, @Nullable Throwable throwable)- See Also:
Log.w(String, String, Throwable)
-
e
@Pure public static void e(@Size(max=23L) String tag, String message)- See Also:
Log.e(String, String)
-
e
@Pure public static void e(@Size(max=23L) String tag, String message, @Nullable Throwable throwable)- See Also:
Log.e(String, String, Throwable)
-
getThrowableString
@Nullable @Pure public static String getThrowableString(@Nullable Throwable throwable)
Returns a string representation of aThrowablesuitable for logging, taking into account whethersetLogStackTraces(boolean)stack trace logging} is enabled.Stack trace logging may be unconditionally suppressed for some expected failure modes (e.g.,
Throwablesthat are expected if the device doesn't have network connectivity) to avoid log spam.
-
-