aconfig: Don't log matching validated flags
Avoid log spam by skipping log statements for matching validated flag entries in the Java codegen. Also change any mismatched logs from info to warning. Change-Id: Icb8bba38d8594438757d76957c4c0188f6c2758a Test: atest aconfig.test Flag: EXEMPT bugfix
This commit is contained in:
@@ -745,10 +745,8 @@ mod tests {
|
|||||||
boolean val;
|
boolean val;
|
||||||
try {
|
try {
|
||||||
val = reader.getBooleanFlagValue(1);
|
val = reader.getBooleanFlagValue(1);
|
||||||
if (val == disabledRw) {
|
if (val != disabledRw) {
|
||||||
Log.i(TAG, String.format(SUCCESS_LOG, "disabledRw"));
|
Log.w(TAG, String.format(MISMATCH_LOG, "disabledRw", val, disabledRw));
|
||||||
} else {
|
|
||||||
Log.i(TAG, String.format(MISMATCH_LOG, "disabledRw", val, disabledRw));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (useNewStorageValueAndDiscardOld) {
|
if (useNewStorageValueAndDiscardOld) {
|
||||||
@@ -756,10 +754,8 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val = reader.getBooleanFlagValue(2);
|
val = reader.getBooleanFlagValue(2);
|
||||||
if (val == disabledRwExported) {
|
if (val != disabledRwExported) {
|
||||||
Log.i(TAG, String.format(SUCCESS_LOG, "disabledRwExported"));
|
Log.w(TAG, String.format(MISMATCH_LOG, "disabledRwExported", val, disabledRwExported));
|
||||||
} else {
|
|
||||||
Log.i(TAG, String.format(MISMATCH_LOG, "disabledRwExported", val, disabledRwExported));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (useNewStorageValueAndDiscardOld) {
|
if (useNewStorageValueAndDiscardOld) {
|
||||||
@@ -767,10 +763,8 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val = reader.getBooleanFlagValue(8);
|
val = reader.getBooleanFlagValue(8);
|
||||||
if (val == enabledRw) {
|
if (val != enabledRw) {
|
||||||
Log.i(TAG, String.format(SUCCESS_LOG, "enabledRw"));
|
Log.w(TAG, String.format(MISMATCH_LOG, "enabledRw", val, enabledRw));
|
||||||
} else {
|
|
||||||
Log.i(TAG, String.format(MISMATCH_LOG, "enabledRw", val, enabledRw));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (useNewStorageValueAndDiscardOld) {
|
if (useNewStorageValueAndDiscardOld) {
|
||||||
@@ -804,10 +798,8 @@ mod tests {
|
|||||||
boolean val;
|
boolean val;
|
||||||
try {
|
try {
|
||||||
val = reader.getBooleanFlagValue(3);
|
val = reader.getBooleanFlagValue(3);
|
||||||
if (val == disabledRwInOtherNamespace) {
|
if (val != disabledRwInOtherNamespace) {
|
||||||
Log.i(TAG, String.format(SUCCESS_LOG, "disabledRwInOtherNamespace"));
|
Log.w(TAG, String.format(MISMATCH_LOG, "disabledRwInOtherNamespace", val, disabledRwInOtherNamespace));
|
||||||
} else {
|
|
||||||
Log.i(TAG, String.format(MISMATCH_LOG, "disabledRwInOtherNamespace", val, disabledRwInOtherNamespace));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (useNewStorageValueAndDiscardOld) {
|
if (useNewStorageValueAndDiscardOld) {
|
||||||
|
@@ -90,10 +90,8 @@ public final class FeatureFlagsImpl implements FeatureFlags \{
|
|||||||
{{ -if flag.is_read_write }}
|
{{ -if flag.is_read_write }}
|
||||||
|
|
||||||
val = reader.getBooleanFlagValue({flag.flag_offset});
|
val = reader.getBooleanFlagValue({flag.flag_offset});
|
||||||
if (val == {flag.method_name}) \{
|
if (val != {flag.method_name}) \{
|
||||||
Log.i(TAG, String.format(SUCCESS_LOG, "{flag.method_name}"));
|
Log.w(TAG, String.format(MISMATCH_LOG, "{flag.method_name}", val, {flag.method_name}));
|
||||||
} else \{
|
|
||||||
Log.i(TAG, String.format(MISMATCH_LOG, "{flag.method_name}", val, {flag.method_name}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (useNewStorageValueAndDiscardOld) \{
|
if (useNewStorageValueAndDiscardOld) \{
|
||||||
|
@@ -5,6 +5,10 @@ public final class Log {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int w(String tag, String msg) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
public static int e(String tag, String msg) {
|
public static int e(String tag, String msg) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user