OSDN Git Service

Enable more logs for networking
authorRuoyao Liu <ruoyao.liu@mediatek.com>
Mon, 21 Jan 2019 03:36:18 +0000 (11:36 +0800)
committerIris Chang <iris.chang@mediatek.com>
Tue, 26 Mar 2019 04:57:17 +0000 (12:57 +0800)
Sometimes we would encounter problems that happen by chance and
hard to reproduce. So we recommend to enable more logs in ENG and
UESRDEBUG load by default.

Bug: 123256412
Test: android.net.ip.IpClientTest can pass
Change-Id: Ia3363de96966a4e86ab550c768fb70317da005ed

packages/NetworkStack/src/android/net/dhcp/DhcpClient.java
packages/NetworkStack/src/android/net/ip/IpReachabilityMonitor.java

index 0b7809e..c6dd011 100644 (file)
@@ -102,9 +102,9 @@ public class DhcpClient extends StateMachine {
 
     private static final String TAG = "DhcpClient";
     private static final boolean DBG = true;
-    private static final boolean STATE_DBG = false;
-    private static final boolean MSG_DBG = false;
-    private static final boolean PACKET_DBG = false;
+    private static final boolean STATE_DBG = Log.isLoggable(TAG, Log.DEBUG);
+    private static final boolean MSG_DBG = Log.isLoggable(TAG, Log.DEBUG);
+    private static final boolean PACKET_DBG = Log.isLoggable(TAG, Log.DEBUG);
 
     // Metrics events: must be kept in sync with server-side aggregation code.
     /** Represents transitions from DhcpInitState to DhcpBoundState */
index 3aa6933..c19a24e 100644 (file)
@@ -129,8 +129,8 @@ import java.util.Map;
  */
 public class IpReachabilityMonitor {
     private static final String TAG = "IpReachabilityMonitor";
-    private static final boolean DBG = false;
-    private static final boolean VDBG = false;
+    private static final boolean DBG = Log.isLoggable(TAG, Log.DEBUG);
+    private static final boolean VDBG = Log.isLoggable(TAG, Log.VERBOSE);
 
     public interface Callback {
         // This callback function must execute as quickly as possible as it is