Class Log
- java.lang.Object
-
- com.google.android.exoplayer2.util.Log
-
@Deprecated public final class Log extends Object
Deprecated.com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.Wrapper aroundLog
which allows to set the log level and to specify a custom log output.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Log.Logger
Deprecated.Interface for a logger that can output messages with a tag.static interface
Log.LogLevel
Deprecated.Log level for ExoPlayer logcat logging.
-
Field Summary
Fields Modifier and Type Field Description static int
LOG_LEVEL_ALL
Deprecated.Log level to log all messages.static int
LOG_LEVEL_ERROR
Deprecated.Log level to only log error messages.static int
LOG_LEVEL_INFO
Deprecated.Log level to only log informative, warning and error messages.static int
LOG_LEVEL_OFF
Deprecated.Log level to disable all logging.static int
LOG_LEVEL_WARNING
Deprecated.Log level to only log warning and error messages.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
d(String tag, String message)
Deprecated.static void
d(String tag, String message, Throwable throwable)
Deprecated.static void
e(String tag, String message)
Deprecated.static void
e(String tag, String message, Throwable throwable)
Deprecated.static @com.google.android.exoplayer2.util.Log.LogLevel int
getLogLevel()
Deprecated.Returns currentLog.LogLevel
for ExoPlayer logcat logging.static String
getThrowableString(Throwable throwable)
Deprecated.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)
Deprecated.static void
i(String tag, String message, Throwable throwable)
Deprecated.static void
setLogger(Log.Logger logger)
Deprecated.Sets a customLog.Logger
as the output.static void
setLogLevel(@com.google.android.exoplayer2.util.Log.LogLevel int logLevel)
Deprecated.Sets theLog.LogLevel
for ExoPlayer logcat logging.static void
setLogStackTraces(boolean logStackTraces)
Deprecated.Sets whether stack traces ofThrowable
s will be logged to logcat.static void
w(String tag, String message)
Deprecated.static void
w(String tag, String message, Throwable throwable)
Deprecated.
-
-
-
Field Detail
-
LOG_LEVEL_ALL
public static final int LOG_LEVEL_ALL
Deprecated.Log level to log all messages.- See Also:
- Constant Field Values
-
LOG_LEVEL_INFO
public static final int LOG_LEVEL_INFO
Deprecated.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
Deprecated.Log level to only log warning and error messages.- See Also:
- Constant Field Values
-
LOG_LEVEL_ERROR
public static final int LOG_LEVEL_ERROR
Deprecated.Log level to only log error messages.- See Also:
- Constant Field Values
-
LOG_LEVEL_OFF
public static final int LOG_LEVEL_OFF
Deprecated.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()
Deprecated.Returns currentLog.LogLevel
for ExoPlayer logcat logging.
-
setLogLevel
public static void setLogLevel(@com.google.android.exoplayer2.util.Log.LogLevel int logLevel)
Deprecated.Sets theLog.LogLevel
for ExoPlayer logcat logging.- Parameters:
logLevel
- The newLog.LogLevel
.
-
setLogStackTraces
public static void setLogStackTraces(boolean logStackTraces)
Deprecated.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.
-
setLogger
public static void setLogger(Log.Logger logger)
Deprecated.Sets a customLog.Logger
as the output.- Parameters:
logger
- TheLog.Logger
.
-
d
@Pure public static void d(@Size(max=23L) String tag, String message)
Deprecated.- See Also:
Log.d(String, String)
-
d
@Pure public static void d(@Size(max=23L) String tag, String message, @Nullable Throwable throwable)
Deprecated.- See Also:
Log.d(String, String, Throwable)
-
i
@Pure public static void i(@Size(max=23L) String tag, String message)
Deprecated.- See Also:
Log.i(String, String)
-
i
@Pure public static void i(@Size(max=23L) String tag, String message, @Nullable Throwable throwable)
Deprecated.- See Also:
Log.i(String, String, Throwable)
-
w
@Pure public static void w(@Size(max=23L) String tag, String message)
Deprecated.- See Also:
Log.w(String, String)
-
w
@Pure public static void w(@Size(max=23L) String tag, String message, @Nullable Throwable throwable)
Deprecated.- See Also:
Log.w(String, String, Throwable)
-
e
@Pure public static void e(@Size(max=23L) String tag, String message)
Deprecated.- See Also:
Log.e(String, String)
-
e
@Pure public static void e(@Size(max=23L) String tag, String message, @Nullable Throwable throwable)
Deprecated.- See Also:
Log.e(String, String, Throwable)
-
getThrowableString
@Nullable @Pure public static String getThrowableString(@Nullable Throwable throwable)
Deprecated.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.
-
-