summaryrefslogtreecommitdiff
path: root/service/java/com/android/server/wifi/WifiDiagnostics.java
diff options
context:
space:
mode:
authormukesh agrawal <quiche@google.com>2016-08-05 14:29:30 -0700
committermukesh agrawal <quiche@google.com>2016-08-09 15:18:29 -0700
commitf5d90be206db98bbd5894afc8d757dd32360b2d9 (patch)
tree8576d7759a6be58ba0e7c8a0ea9de189a8780328 /service/java/com/android/server/wifi/WifiDiagnostics.java
parentf46c533931224296b11d98798344c049f88db9a1 (diff)
downloadwifi-f5d90be206db98bbd5894afc8d757dd32360b2d9.tar.gz
logging: add convenience APIs for literal messages
Literal messages are reasonably common, so we should make them easy to log. Add APIs for that purpose, and migrate WifiDiagnostics to use them. Note that, functionally speaking, the LogcatLog implementations of these APIs behave the same their corresponding legacy APIs. However, we add these APIs for two reasons: - To track which log messages have been audited, to determine whether or not they contain parameters. - So that the WifiLog implementation for the new backend can inform the backend that these messages are clean (free of any sensitive data). Finally, we note that these convenience APIs may also provide a performance benefit. (Because the message is parameter-less, there's no need to create a LogMessage.) While there: change the level of some WifiDiagnostics log messages, to fit our new logging guidelines. BUG=30737889 TEST=wifitests/runtests.sh Change-Id: I3d39c1932800af6a818c59b6497c868f8399f8fa
Diffstat (limited to 'service/java/com/android/server/wifi/WifiDiagnostics.java')
-rw-r--r--service/java/com/android/server/wifi/WifiDiagnostics.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/service/java/com/android/server/wifi/WifiDiagnostics.java b/service/java/com/android/server/wifi/WifiDiagnostics.java
index 160cf6bdf..777f46358 100644
--- a/service/java/com/android/server/wifi/WifiDiagnostics.java
+++ b/service/java/com/android/server/wifi/WifiDiagnostics.java
@@ -154,7 +154,7 @@ class WifiDiagnostics extends BaseWifiDiagnostics {
}
if (!mWifiNative.startPktFateMonitoring()) {
- mLog.e("Failed to start packet fate monitoring");
+ mLog.wC("Failed to start packet fate monitoring");
}
}
@@ -163,7 +163,7 @@ class WifiDiagnostics extends BaseWifiDiagnostics {
if (mPerPacketRingBuffer != null) {
startLoggingRingBuffer(mPerPacketRingBuffer);
} else {
- if (DBG) mLog.d("There is no per packet ring buffer");
+ if (DBG) mLog.tC("There is no per packet ring buffer");
}
}
@@ -172,7 +172,7 @@ class WifiDiagnostics extends BaseWifiDiagnostics {
if (mPerPacketRingBuffer != null) {
stopLoggingRingBuffer(mPerPacketRingBuffer);
} else {
- if (DBG) mLog.d("There is no per packet ring buffer");
+ if (DBG) mLog.tC("There is no per packet ring buffer");
}
}
@@ -180,9 +180,9 @@ class WifiDiagnostics extends BaseWifiDiagnostics {
public synchronized void stopLogging() {
if (mIsLoggingEventHandlerRegistered) {
if (!mWifiNative.resetLogHandler()) {
- mLog.e("Fail to reset log handler");
+ mLog.wC("Fail to reset log handler");
} else {
- if (DBG) mLog.d("Reset log handler");
+ if (DBG) mLog.tC("Reset log handler");
}
// Clear mIsLoggingEventHandlerRegistered even if resetLogHandler() failed, because
// the log handler is in an indeterminate state.
@@ -424,7 +424,7 @@ class WifiDiagnostics extends BaseWifiDiagnostics {
}
}
} else {
- mLog.e("no ring buffers found");
+ mLog.wC("no ring buffers found");
}
return mRingBuffers != null;
@@ -439,7 +439,7 @@ class WifiDiagnostics extends BaseWifiDiagnostics {
private boolean startLoggingAllExceptPerPacketBuffers() {
if (mRingBuffers == null) {
- if (DBG) mLog.d("No ring buffers to log anything!");
+ if (DBG) mLog.tC("No ring buffers to log anything!");
return false;
}
@@ -544,7 +544,7 @@ class WifiDiagnostics extends BaseWifiDiagnostics {
compressor.end();
bos.close();
} catch (IOException e) {
- mLog.e("ByteArrayOutputStream close error");
+ mLog.wC("ByteArrayOutputStream close error");
result = android.util.Base64.encodeToString(input, Base64.DEFAULT);
return result;
}
@@ -588,7 +588,7 @@ class WifiDiagnostics extends BaseWifiDiagnostics {
}
private LimitedCircularArray<String> getKernelLog(int maxLines) {
- if (DBG) mLog.d("Reading kernel log ...");
+ if (DBG) mLog.tC("Reading kernel log ...");
LimitedCircularArray<String> lines = new LimitedCircularArray<String>(maxLines);
String log = mWifiNative.readKernelLog();
String logLines[] = log.split("\n");