Note
Set ENABLE_LOGGING to 1 in ProductFlags.h to enable logging in native layer.
In native levels are define as following:
LOGGER_OFF = Logger.OFF
LOGGER_ERROR = Logger.ERROR
LOGGER_WARNING = Logger.WARNING
LOGGER_INFO = Logger.INFO
LOGGER_DEBUG = Logger.DEBUG
Use following macros to log in native level:
LOGGER_LOGMSG() = void logMsg(int level, String msg)
LOGGER_LOGMSG_CM() = void logMsg(int level, String sourceClass, String sourceMethod, String msg)
Examples:
LOGGER_LOGMSG(LOGGER_DEBUG, "Initializing NativeMediaManager");
LOGGER_LOGMSG_CM(LOGGER_DEBUG, "None", "nativeInitNativeMediaManager", "Initializing NativeMediaManager");
| Modifier and Type | Field and Description |
|---|---|
| private static int | |
| public static final int | DEBUG
DEBUG is a message level providing tracing information. |
| public static final int | ERROR
ERROR is a message level indicating a serious failure. |
| public static final int | INFO
INFO is a message level for informational messages. |
| private static final Object | |
| public static final int | OFF
OFF is a special level that can be used to turn off logging. |
| private static long | |
| public static final int | WARNING
WARNING is a message level indicating a potential problem. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static boolean | Returns: true if message will be logged, false otherwise.messgae level level)Checks if message at specific level can be logged. |
| private static String | |
| public static boolean | |
| public static void | |
| public static void | |
| private static native boolean | |
| private static native void | |
| public static void | |
| private static void |
| currentLevel | back to summary |
|---|---|
| private static int currentLevel | |
| DEBUG | back to summary |
|---|---|
| public static final int DEBUG DEBUG is a message level providing tracing information. This level is initialized to 1. | |
| ERROR | back to summary |
|---|---|
| public static final int ERROR ERROR is a message level indicating a serious failure. This level is initialized to 4. | |
| INFO | back to summary |
|---|---|
| public static final int INFO INFO is a message level for informational messages. This level is initialized to 2. | |
| lock | back to summary |
|---|---|
| private static final Object lock | |
| OFF | back to summary |
|---|---|
| public static final int OFF OFF is a special level that can be used to turn off logging. This level is initialized to Integer.MAX_VALUE. | |
| startTime | back to summary |
|---|---|
| private static long startTime | |
| WARNING | back to summary |
|---|---|
| public static final int WARNING WARNING is a message level indicating a potential problem. This level is initialized to 3. | |
| Logger | back to summary |
|---|---|
| private Logger() | |
| canLog | back to summary |
|---|---|
| public static boolean canLog(int level) Checks if message at specific level can be logged.
| |
| getTimestamp | back to summary |
|---|---|
| private static String getTimestamp() Get timestamp based on current time
| |
| initNative | back to summary |
|---|---|
| public static boolean initNative() Initializes logger. This function should be called once before using any other logger functions. | |
| logMsg | back to summary |
|---|---|
| public static void logMsg(int level, String msg) Log message
| |
| logMsg | back to summary |
|---|---|
| public static void logMsg(int level, String sourceClass, String sourceMethod, String msg) Log message | |
| nativeInit | back to summary |
|---|---|
| private static native boolean nativeInit() | |
| nativeSetNativeLevel | back to summary |
|---|---|
| private static native void nativeSetNativeLevel(int level) | |
| setLevel | back to summary |
|---|---|
| public static void setLevel(int level) Sets logger level. All messages below logger level will be ignored. For example, if level is set to WARNING, only messages with ERROR and WARNING levels will be logged and messages with INFO and DEBUG levels will be ignored.
| |
| startLogger | back to summary |
|---|---|
| private static void startLogger() This must be run in a privileged context | |