Package com.brightcove.player.logging
Class Log
java.lang.Object
com.brightcove.player.logging.Log
A simple wrapper for
Log that supports log message formatting and turning
on or off logging based on tag.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceThe list of possible of logging levels. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe level for debug log messages.static final intThe level for error log messages.static final intThe level for information log messages.static final intThe level for verbose log messages.static final intThe level for warning log messages. -
Method Summary
Modifier and TypeMethodDescriptionstatic intLogs a debug message.static intLogs a debug message.static intLogs an error message.static intLogs an error message.static intLogs an information message.static intLogs an information message.static booleanisLoggable(String tag, int level) Checks to see whether or not a log for the specified tag is loggable at the specified level.static intLogs a verbose message.static intLogs a verbose message.static intLogs a warning message.static intLogs a warning message.
-
Field Details
-
DEBUG
public static final int DEBUGThe level for debug log messages.- See Also:
-
ERROR
public static final int ERRORThe level for error log messages.- See Also:
-
INFO
public static final int INFOThe level for information log messages.- See Also:
-
VERBOSE
public static final int VERBOSEThe level for verbose log messages.- See Also:
-
WARN
public static final int WARNThe level for warning log messages.- See Also:
-
-
Method Details
-
isLoggable
Checks to see whether or not a log for the specified tag is loggable at the specified level. The default level of any tag is set to INFO. This means that any level above and including INFO will be logged. Before you make any calls to a logging method you should check to see if your tag should be logged. You can change the default level by setting a system property: 'setprop log.tag.' Where level is either VERBOSE, DEBUG, INFO, WARN, ERROR, ASSERT, or SUPPRESS. SUPPRESS will turn off all logging for your tag. You can also create a local.prop file that with the following in it: 'log.tag. = ' and place that in /data/local.prop. - Parameters:
tag- The tag to check.level- The level to check.- Returns:
- true if the tag this is allowed to be logged, otherwise false.
-
v
Logs a verbose message.- Parameters:
tag- the string that will ssed to identify the source of a log message. It usually identifies the class or activity where the log call occurs.message- the message to be logged. The message may contain formatting token supported byString.format(String, Object...)method.arguments- an array of objects to be used for formatting the log message.- Returns:
- The number of bytes written.
-
v
public static int v(@NonNull String tag, @NonNull String message, Throwable error, Object... arguments) Logs a verbose message.- Parameters:
tag- the string that will ssed to identify the source of a log message. It usually identifies the class or activity where the log call occurs.message- the message to be logged. The message may contain formatting token supported byString.format(String, Object...)method.error- the error to be logged, if any.arguments- an array of objects to be used for formatting the log message.- Returns:
- The number of bytes written.
-
d
Logs a debug message.- Parameters:
tag- the string that will ssed to identify the source of a log message. It usually identifies the class or activity where the log call occurs.message- the message to be logged. The message may contain formatting token supported byString.format(String, Object...)method.arguments- an array of objects to be used for formatting the log message.- Returns:
- The number of bytes written.
-
d
public static int d(@NonNull String tag, @NonNull String message, Throwable error, Object... arguments) Logs a debug message.- Parameters:
tag- the string that will ssed to identify the source of a log message. It usually identifies the class or activity where the log call occurs.message- the message to be logged. The message may contain formatting token supported byString.format(String, Object...)method.error- the error to be logged, if any.arguments- an array of objects to be used for formatting the log message.- Returns:
- The number of bytes written.
-
i
Logs an information message.- Parameters:
tag- the string that will ssed to identify the source of a log message. It usually identifies the class or activity where the log call occurs.message- the message to be logged. The message may contain formatting token supported byString.format(String, Object...)method.arguments- an array of objects to be used for formatting the log message.- Returns:
- The number of bytes written.
-
i
public static int i(@NonNull String tag, @NonNull String message, Throwable error, Object... arguments) Logs an information message.- Parameters:
tag- the string that will ssed to identify the source of a log message. It usually identifies the class or activity where the log call occurs.message- the message to be logged. The message may contain formatting token supported byString.format(String, Object...)method.error- the error to be logged, if any.arguments- an array of objects to be used for formatting the log message.- Returns:
- The number of bytes written.
-
w
Logs a warning message.- Parameters:
tag- the string that will ssed to identify the source of a log message. It usually identifies the class or activity where the log call occurs.message- the message to be logged. The message may contain formatting token supported byString.format(String, Object...)method.arguments- an array of objects to be used for formatting the log message.- Returns:
- The number of bytes written.
-
w
public static int w(@NonNull String tag, @NonNull String message, Throwable error, Object... arguments) Logs a warning message.- Parameters:
tag- the string that will ssed to identify the source of a log message. It usually identifies the class or activity where the log call occurs.message- the message to be logged. The message may contain formatting token supported byString.format(String, Object...)method.error- the error to be logged, if any.arguments- an array of objects to be used for formatting the log message.- Returns:
- The number of bytes written.
-
e
Logs an error message.- Parameters:
tag- the string that will ssed to identify the source of a log message. It usually identifies the class or activity where the log call occurs.message- the message to be logged. The message may contain formatting token supported byString.format(String, Object...)method.arguments- an array of objects to be used for formatting the log message.- Returns:
- The number of bytes written.
-
e
public static int e(@NonNull String tag, @NonNull String message, Throwable error, Object... arguments) Logs an error message.- Parameters:
tag- the string that will ssed to identify the source of a log message. It usually identifies the class or activity where the log call occurs.message- the message to be logged. The message may contain formatting token supported byString.format(String, Object...)method.error- the error to be logged, if any.arguments- an array of objects to be used for formatting the log message.- Returns:
- The number of bytes written.
-