Turn off verbose logging
This CL turns off the verbose logging if LOG_NDEBUG is 1, or if NDEBUG is defined. You can set the environment variable LOG_NDEBUG to 0 to turn on verbose debugging for the CDM library on android. Also, as in b/9672657, some applications call SelectKey when switching between video and audio, which is much too verbose and affects playback. I have removed the log statements for SelectKey. bug: 9672657 Change-Id: I635b997118996871356f7126852b4744fb05e810
This commit is contained in:
@@ -2,6 +2,20 @@
|
||||
//
|
||||
// Log - implemented using the standard Android logging mechanism
|
||||
|
||||
/*
|
||||
* Qutoing from system/core/include/log/log.h:
|
||||
* Normally we strip ALOGV (VERBOSE messages) from release builds.
|
||||
* You can modify this (for example with "#define LOG_NDEBUG 0"
|
||||
* at the top of your source file) to change that behavior.
|
||||
*/
|
||||
#ifndef LOG_NDEBUG
|
||||
#ifdef NDEBUG
|
||||
#define LOG_NDEBUG 1
|
||||
#else
|
||||
#define LOG_NDEBUG 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define LOG_TAG "WVCdm"
|
||||
#define LOG_BUF_SIZE 1024
|
||||
|
||||
@@ -26,7 +40,11 @@ void Log(const char* file, int line, LogPriority level, const char* fmt, ...) {
|
||||
case LOG_WARN: prio = ANDROID_LOG_WARN; break;
|
||||
case LOG_INFO: prio = ANDROID_LOG_INFO; break;
|
||||
case LOG_DEBUG: prio = ANDROID_LOG_DEBUG; break;
|
||||
#if LOG_NDEBUG
|
||||
case LOG_VERBOSE: return;
|
||||
#else
|
||||
case LOG_VERBOSE: prio = ANDROID_LOG_VERBOSE; break;
|
||||
#endif
|
||||
}
|
||||
|
||||
__android_log_write(prio, LOG_TAG, buf);
|
||||
|
||||
Reference in New Issue
Block a user