Class Log
- java.lang.Object
-
- com.google.android.exoplayer2.util.Log
-
-
Field Summary
Fields Modifier and Type Field Description static int
LOG_LEVEL_ALL
Log level to log all messages.static int
LOG_LEVEL_ERROR
Log level to only log error messages.static int
LOG_LEVEL_INFO
Log level to only log informative, warning and error messages.static int
LOG_LEVEL_OFF
Log level to disable all logging.static int
LOG_LEVEL_WARNING
Log level to only log warning and error messages.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
d(String tag, String message)
static void
d(String tag, String message, Throwable throwable)
static void
e(String tag, String message)
static void
e(String tag, String message, Throwable throwable)
static int
getLogLevel()
Returns currentLog.LogLevel
for ExoPlayer logcat logging.static String
getThrowableString(Throwable throwable)
Returns a string representation of aThrowable
suitable for logging, taking into account whethersetLogStackTraces(boolean)
stack trace logging} is enabled.static void
i(String tag, String message)
static void
i(String tag, String message, Throwable throwable)
static void
setLogLevel(int logLevel)
Sets theLog.LogLevel
for ExoPlayer logcat logging.static void
setLogStackTraces(boolean logStackTraces)
Sets whether stack traces ofThrowable
s will be logged to logcat.static void
w(String tag, String message)
static void
w(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 @LogLevel public static int getLogLevel()
Returns currentLog.LogLevel
for ExoPlayer logcat logging.
-
setLogLevel
public static void setLogLevel(@LogLevel int logLevel)
Sets theLog.LogLevel
for ExoPlayer logcat logging.- Parameters:
logLevel
- The newLog.LogLevel
.
-
setLogStackTraces
public static void setLogStackTraces(boolean logStackTraces)
Sets whether stack traces ofThrowable
s 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(String tag, String message)
- See Also:
Log.d(String, String)
-
d
@Pure public static void d(String tag, String message, @Nullable Throwable throwable)
- See Also:
Log.d(String, String, Throwable)
-
i
@Pure public static void i(String tag, String message)
- See Also:
Log.i(String, String)
-
i
@Pure public static void i(String tag, String message, @Nullable Throwable throwable)
- See Also:
Log.i(String, String, Throwable)
-
w
@Pure public static void w(String tag, String message)
- See Also:
Log.w(String, String)
-
w
@Pure public static void w(String tag, String message, @Nullable Throwable throwable)
- See Also:
Log.w(String, String, Throwable)
-
e
@Pure public static void e(String tag, String message)
- See Also:
Log.e(String, String)
-
e
@Pure public static void e(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 aThrowable
suitable 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.,
Throwables
that are expected if the device doesn't have network connectivity) to avoid log spam.
-
-