Commit e7ece9e2 by Courtney Goeltzenleuchter Committed by Commit Bot

Do not include ALOGV in release builds

To match behavior of ALOGV in Android system code, disable output in release builds. Bug=angleproject:2418 Change-Id: I657ec366249f9d5defe9b05fe298099c47389580 Reviewed-on: https://chromium-review.googlesource.com/c/1269819Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarIan Elliott <ianelliott@google.com> Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com>
parent 3f21fcb9
......@@ -229,6 +229,9 @@ config("angle_feature_support_util_config") {
"src",
]
defines = [ "LIBANGLE_UTIL_IMPLEMENTATION" ]
if (is_debug) {
defines += [ "ANGLE_FEATURE_UTIL_LOG_VERBOSE" ]
}
}
static_library("angle_feature_support_util") {
......
......@@ -19,11 +19,18 @@
#if defined(ANDROID)
#include <android/log.h>
// Define ANGLE_FEATURE_UTIL_LOG_VERBOSE if you want ALOGV to output
// ANGLE_FEATURE_UTIL_LOG_VERBOSE is automatically defined when is_debug = true
#define ALOGE(...) __android_log_print(ANDROID_LOG_ERROR, "ANGLE", __VA_ARGS__)
#define ALOGW(...) __android_log_print(ANDROID_LOG_WARN, "ANGLE", __VA_ARGS__)
#define ALOGI(...) __android_log_print(ANDROID_LOG_INFO, "ANGLE", __VA_ARGS__)
#define ALOGD(...) __android_log_print(ANDROID_LOG_DEBUG, "ANGLE", __VA_ARGS__)
#ifdef ANGLE_FEATURE_UTIL_LOG_VERBOSE
#define ALOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, "ANGLE", __VA_ARGS__)
#else
#define ALOGV(...) ((void)0)
#endif
#else // defined(ANDROID)
#define ALOGE(...) printf(__VA_ARGS__);
#define ALOGW(...) printf(__VA_ARGS__);
......@@ -191,8 +198,8 @@ class ListOf
}
else
{
int nItems = mList.size();
ALOGV("%sListOf%s is has %d item(s):", prefix.c_str(), name.c_str(), nItems);
ALOGV("%sListOf%s is has %d item(s):", prefix.c_str(), name.c_str(),
static_cast<int>(mList.size()));
for (auto &it : mList)
{
it.logItem();
......@@ -751,8 +758,8 @@ class RuleList
// Initialize the choice to the system-wide default (that should be set in the default
// rule, but just in case, set it here too):
bool appChoice = true;
int nRules = mRuleList.size();
ALOGV("Checking scenario against %d ANGLE-for-Android rules:", nRules);
ALOGV("Checking scenario against %d ANGLE-for-Android rules:",
static_cast<int>(mRuleList.size()));
for (auto &it : mRuleList)
{
......@@ -777,8 +784,8 @@ class RuleList
// Initialize the answer to the system-wide default (that should be set in the default
// rule, but just in case, set it here too):
bool answer = false;
int nRules = mRuleList.size();
ALOGV("Checking scenario against %d ANGLE-for-Android rules:", nRules);
ALOGV("Checking scenario against %d ANGLE-for-Android rules:",
static_cast<int>(mRuleList.size()));
for (auto &it : mRuleList)
{
......@@ -876,8 +883,7 @@ class RuleList
}
void logRules()
{
int nRules = mRuleList.size();
ALOGV("Showing %d ANGLE-for-Android rules:", nRules);
ALOGV("Showing %d ANGLE-for-Android rules:", static_cast<int>(mRuleList.size()));
for (auto &it : mRuleList)
{
it.logRule();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment