* Add dummy comments to blank files git5 patch does not seem to handle blank files well. This CL will allow the new CDM interface to be tested on iOS before it is officially merged in google3. * Stop Parsing the Command Line in InitLogging [ Merge of http://go/wvgerrit/14164 ] This change removes the parameters from InitLogging() and removes the code in the Linux implementation that was using them. Change-Id: I65849a89a2fac10cfc86eb16165bfcad468140aa
64 lines
1.4 KiB
C++
64 lines
1.4 KiB
C++
// Copyright 2013 Google Inc. All Rights Reserved.
|
|
//
|
|
// 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
|
|
|
|
#include "log.h"
|
|
#include <utils/Log.h>
|
|
|
|
/*
|
|
* Uncomment the line below if you want to have the LOGV messages to print
|
|
* IMPORTANT : this will affect all of CDM
|
|
*/
|
|
|
|
// #define LOG_NDEBUG 0
|
|
|
|
namespace wvcdm {
|
|
|
|
LogPriority g_cutoff = LOG_VERBOSE;
|
|
|
|
void InitLogging() {}
|
|
|
|
void Log(const char* /* file */, int /* line */, LogPriority level,
|
|
const char* fmt, ...) {
|
|
va_list ap;
|
|
char buf[LOG_BUF_SIZE];
|
|
va_start(ap, fmt);
|
|
vsnprintf(buf, LOG_BUF_SIZE, fmt, ap);
|
|
va_end(ap);
|
|
|
|
android_LogPriority prio = ANDROID_LOG_VERBOSE;
|
|
|
|
switch(level) {
|
|
case LOG_ERROR: prio = ANDROID_LOG_ERROR; break;
|
|
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);
|
|
}
|
|
|
|
} // namespace wvcdm
|