Enable Network debug log draft
authorEdgar Chen <echen@mozilla.com>
Fri, 09 Jan 2015 09:43:05 +0800
changeset 325621 a59bed206d74f3c16ca5c3f3f15fbc15ee673d1e
parent 325620 f9ab49da1c01702fde7aa3a71f270be048b19c59
child 325622 10f682faba2092134658c3663182dee85ecefd87
push id10012
push userechen@mozilla.com
push dateTue, 26 Jan 2016 02:39:11 +0000
milestone46.0a1
Enable Network debug log
dom/system/gonk/NetworkManager.js
dom/system/gonk/NetworkService.js
dom/system/gonk/NetworkUtils.cpp
--- a/dom/system/gonk/NetworkManager.js
+++ b/dom/system/gonk/NetworkManager.js
@@ -62,17 +62,17 @@ const CONNECTION_TYPE_WIFI      = 3;
 const CONNECTION_TYPE_OTHER     = 4;
 const CONNECTION_TYPE_NONE      = 5;
 
 const PROXY_TYPE_MANUAL = Ci.nsIProtocolProxyService.PROXYCONFIG_MANUAL;
 const PROXY_TYPE_PAC    = Ci.nsIProtocolProxyService.PROXYCONFIG_PAC;
 
 var debug;
 function updateDebug() {
-  let debugPref = false; // set default value here.
+  let debugPref = true; // set default value here.
   try {
     debugPref = debugPref || Services.prefs.getBoolPref(PREF_NETWORK_DEBUG_ENABLED);
   } catch (e) {}
 
   if (debugPref) {
     debug = function(s) {
       dump("-*- NetworkManager: " + s + "\n");
     };
--- a/dom/system/gonk/NetworkService.js
+++ b/dom/system/gonk/NetworkService.js
@@ -34,17 +34,17 @@ const NETD_COMMAND_FAIL         = 400;
 const NETD_COMMAND_ERROR        = 500;
 // 6xx - Unsolicited broadcasts
 const NETD_COMMAND_UNSOLICITED  = 600;
 
 const WIFI_CTRL_INTERFACE = "wl0.1";
 
 var debug;
 function updateDebug() {
-  let debugPref = false; // set default value here.
+  let debugPref = true; // set default value here.
   try {
     debugPref = debugPref || Services.prefs.getBoolPref(PREF_NETWORK_DEBUG_ENABLED);
   } catch (e) {}
 
   if (debugPref) {
     debug = function(s) {
       dump("-*- NetworkService: " + s + "\n");
     };
--- a/dom/system/gonk/NetworkUtils.cpp
+++ b/dom/system/gonk/NetworkUtils.cpp
@@ -24,17 +24,17 @@
 
 #include <errno.h>
 #include <string.h>
 #include <sys/types.h>  // struct addrinfo
 #include <sys/socket.h> // getaddrinfo(), freeaddrinfo()
 #include <netdb.h>
 #include <arpa/inet.h>  // inet_ntop()
 
-#define _DEBUG 0
+#define _DEBUG 1
 
 #define WARN(args...)   __android_log_print(ANDROID_LOG_WARN,  "NetworkUtils", ## args)
 #define ERROR(args...)  __android_log_print(ANDROID_LOG_ERROR,  "NetworkUtils", ## args)
 
 #if _DEBUG
 #define NU_DBG(args...)  __android_log_print(ANDROID_LOG_DEBUG, "NetworkUtils" , ## args)
 #else
 #define NU_DBG(args...)