You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2014/03/03 21:02:32 UTC

svn commit: r1573718 [1/2] - in /httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http: client/protocol/ conn/ssl/ impl/auth/ impl/client/ impl/conn/ impl/execchain/ impl/io/

Author: olegk
Date: Mon Mar  3 20:02:31 2014
New Revision: 1573718

URL: http://svn.apache.org/r1573718
Log:
Replaced Commons Logging and Codec with Android logging and base64

Modified:
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/client/protocol/RequestAddCookiesHC4.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/client/protocol/RequestClientConnControl.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/client/protocol/ResponseProcessCookiesHC4.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/conn/ssl/AbstractVerifierHC4.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/auth/BasicSchemeHC4.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/auth/HttpAuthenticator.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/client/AuthenticationStrategyImpl.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/client/CloseableHttpClient.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/client/DefaultRedirectStrategy.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/client/InternalHttpClient.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/BasicHttpClientConnectionManager.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/CPool.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/CPoolEntry.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/DefaultHttpResponseParser.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/HttpClientConnectionOperator.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/InMemoryDnsResolver.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/LoggingManagedHttpClientConnection.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/ManagedHttpClientConnectionFactory.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/WireHC4.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/execchain/ConnectionHolder.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/execchain/MainClientExec.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/execchain/MinimalClientExec.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/execchain/ProtocolExec.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/execchain/RedirectExec.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/execchain/RetryExec.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/execchain/ServiceUnavailableRetryExec.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/io/AbstractMessageParserHC4.java
    httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/io/ChunkedOutputStreamHC4.java

Modified: httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/client/protocol/RequestAddCookiesHC4.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/client/protocol/RequestAddCookiesHC4.java?rev=1573718&r1=1573717&r2=1573718&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/client/protocol/RequestAddCookiesHC4.java (original)
+++ httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/client/protocol/RequestAddCookiesHC4.java Mon Mar  3 20:02:31 2014
@@ -34,8 +34,8 @@ import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import android.util.Log;
+
 import org.apache.http.Header;
 import org.apache.http.HttpException;
 import org.apache.http.HttpHost;
@@ -67,7 +67,7 @@ import org.apache.http.util.TextUtils;
 @Immutable
 public class RequestAddCookiesHC4 implements HttpRequestInterceptor {
 
-    private final Log log = LogFactory.getLog(getClass());
+    private final static String TAG = "HttpClient";
 
     public RequestAddCookiesHC4() {
         super();
@@ -88,28 +88,28 @@ public class RequestAddCookiesHC4 implem
         // Obtain cookie store
         final CookieStore cookieStore = clientContext.getCookieStore();
         if (cookieStore == null) {
-            this.log.debug("Cookie store not specified in HTTP context");
+            Log.d(TAG, "Cookie store not specified in HTTP context");
             return;
         }
 
         // Obtain the registry of cookie specs
         final Lookup<CookieSpecProvider> registry = clientContext.getCookieSpecRegistry();
         if (registry == null) {
-            this.log.debug("CookieSpec registry not specified in HTTP context");
+            Log.d(TAG, "CookieSpec registry not specified in HTTP context");
             return;
         }
 
         // Obtain the target host, possibly virtual (required)
         final HttpHost targetHost = clientContext.getTargetHost();
         if (targetHost == null) {
-            this.log.debug("Target host not set in the context");
+            Log.d(TAG, "Target host not set in the context");
             return;
         }
 
         // Obtain the route (required)
         final RouteInfo route = clientContext.getHttpRoute();
         if (route == null) {
-            this.log.debug("Connection route not set in the context");
+            Log.d(TAG, "Connection route not set in the context");
             return;
         }
 
@@ -118,8 +118,8 @@ public class RequestAddCookiesHC4 implem
         if (policy == null) {
             policy = CookieSpecs.BEST_MATCH;
         }
-        if (this.log.isDebugEnabled()) {
-            this.log.debug("CookieSpec selected: " + policy);
+        if (Log.isLoggable(TAG, Log.DEBUG)) {
+            Log.d(TAG, "CookieSpec selected: " + policy);
         }
 
         URI requestURI = null;
@@ -158,14 +158,14 @@ public class RequestAddCookiesHC4 implem
         for (final Cookie cookie : cookies) {
             if (!cookie.isExpired(now)) {
                 if (cookieSpec.match(cookie, cookieOrigin)) {
-                    if (this.log.isDebugEnabled()) {
-                        this.log.debug("Cookie " + cookie + " match " + cookieOrigin);
+                    if (Log.isLoggable(TAG, Log.DEBUG)) {
+                        Log.d(TAG, "Cookie " + cookie + " match " + cookieOrigin);
                     }
                     matchedCookies.add(cookie);
                 }
             } else {
-                if (this.log.isDebugEnabled()) {
-                    this.log.debug("Cookie " + cookie + " expired");
+                if (Log.isLoggable(TAG, Log.DEBUG)) {
+                    Log.d(TAG, "Cookie " + cookie + " expired");
                 }
             }
         }

Modified: httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java?rev=1573718&r1=1573717&r2=1573718&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java (original)
+++ httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java Mon Mar  3 20:02:31 2014
@@ -29,8 +29,8 @@ package org.apache.http.client.protocol;
 
 import java.io.IOException;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import android.util.Log;
+
 import org.apache.http.HttpException;
 import org.apache.http.HttpHost;
 import org.apache.http.HttpRequest;
@@ -57,7 +57,7 @@ import org.apache.http.util.Args;
 @Immutable
 public class RequestAuthCache implements HttpRequestInterceptor {
 
-    private final Log log = LogFactory.getLog(getClass());
+    private final static String TAG = "HttpClient";
 
     public RequestAuthCache() {
         super();
@@ -72,13 +72,13 @@ public class RequestAuthCache implements
 
         final AuthCache authCache = clientContext.getAuthCache();
         if (authCache == null) {
-            this.log.debug("Auth cache not set in the context");
+            Log.d(TAG, "Auth cache not set in the context");
             return;
         }
 
         final CredentialsProvider credsProvider = clientContext.getCredentialsProvider();
         if (credsProvider == null) {
-            this.log.debug("Credentials provider not set in the context");
+            Log.d(TAG, "Credentials provider not set in the context");
             return;
         }
 
@@ -115,8 +115,8 @@ public class RequestAuthCache implements
             final AuthStateHC4 authState,
             final CredentialsProvider credsProvider) {
         final String schemeName = authScheme.getSchemeName();
-        if (this.log.isDebugEnabled()) {
-            this.log.debug("Re-using cached '" + schemeName + "' auth scheme for " + host);
+        if (Log.isLoggable(TAG, Log.DEBUG)) {
+            Log.d(TAG, "Re-using cached '" + schemeName + "' auth scheme for " + host);
         }
 
         final AuthScope authScope = new AuthScope(host.getHostName(), host.getPort(), AuthScope.ANY_REALM, schemeName);
@@ -130,7 +130,7 @@ public class RequestAuthCache implements
             }
             authState.update(authScheme, creds);
         } else {
-            this.log.debug("No credentials for preemptive authentication");
+            Log.d(TAG, "No credentials for preemptive authentication");
         }
     }
 

Modified: httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/client/protocol/RequestClientConnControl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/client/protocol/RequestClientConnControl.java?rev=1573718&r1=1573717&r2=1573718&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/client/protocol/RequestClientConnControl.java (original)
+++ httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/client/protocol/RequestClientConnControl.java Mon Mar  3 20:02:31 2014
@@ -29,8 +29,8 @@ package org.apache.http.client.protocol;
 
 import java.io.IOException;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import android.util.Log;
+
 import org.apache.http.HttpException;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpRequestInterceptor;
@@ -50,7 +50,7 @@ import org.apache.http.util.Args;
 @Immutable
 public class RequestClientConnControl implements HttpRequestInterceptor {
 
-    private final Log log = LogFactory.getLog(getClass());
+    private final static String TAG = "HttpClient";
 
     private static final String PROXY_CONN_DIRECTIVE = "Proxy-Connection";
 
@@ -73,7 +73,7 @@ public class RequestClientConnControl im
         // Obtain the client connection (required)
         final RouteInfo route = clientContext.getHttpRoute();
         if (route == null) {
-            this.log.debug("Connection route not set in the context");
+            Log.d(TAG, "Connection route not set in the context");
             return;
         }
 

Modified: httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/client/protocol/ResponseProcessCookiesHC4.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/client/protocol/ResponseProcessCookiesHC4.java?rev=1573718&r1=1573717&r2=1573718&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/client/protocol/ResponseProcessCookiesHC4.java (original)
+++ httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/client/protocol/ResponseProcessCookiesHC4.java Mon Mar  3 20:02:31 2014
@@ -30,8 +30,8 @@ package org.apache.http.client.protocol;
 import java.io.IOException;
 import java.util.List;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import android.util.Log;
+
 import org.apache.http.Header;
 import org.apache.http.HeaderIterator;
 import org.apache.http.HttpException;
@@ -56,7 +56,7 @@ import org.apache.http.util.Args;
 @Immutable
 public class ResponseProcessCookiesHC4 implements HttpResponseInterceptor {
 
-    private final Log log = LogFactory.getLog(getClass());
+    private final static String TAG = "HttpClient";
 
     public ResponseProcessCookiesHC4() {
         super();
@@ -72,19 +72,19 @@ public class ResponseProcessCookiesHC4 i
         // Obtain actual CookieSpec instance
         final CookieSpec cookieSpec = clientContext.getCookieSpec();
         if (cookieSpec == null) {
-            this.log.debug("Cookie spec not specified in HTTP context");
+            Log.d(TAG, "Cookie spec not specified in HTTP context");
             return;
         }
         // Obtain cookie store
         final CookieStore cookieStore = clientContext.getCookieStore();
         if (cookieStore == null) {
-            this.log.debug("Cookie store not specified in HTTP context");
+            Log.d(TAG, "Cookie store not specified in HTTP context");
             return;
         }
         // Obtain actual CookieOrigin instance
         final CookieOrigin cookieOrigin = clientContext.getCookieOrigin();
         if (cookieOrigin == null) {
-            this.log.debug("Cookie origin not specified in HTTP context");
+            Log.d(TAG, "Cookie origin not specified in HTTP context");
             return;
         }
         HeaderIterator it = response.headerIterator(SM.SET_COOKIE);
@@ -113,19 +113,19 @@ public class ResponseProcessCookiesHC4 i
                         cookieSpec.validate(cookie, cookieOrigin);
                         cookieStore.addCookie(cookie);
 
-                        if (this.log.isDebugEnabled()) {
-                            this.log.debug("Cookie accepted [" + formatCooke(cookie) + "]");
+                        if (Log.isLoggable(TAG, Log.DEBUG)) {
+                            Log.d(TAG, "Cookie accepted [" + formatCooke(cookie) + "]");
                         }
                     } catch (final MalformedCookieException ex) {
-                        if (this.log.isWarnEnabled()) {
-                            this.log.warn("Cookie rejected [" + formatCooke(cookie) + "] "
+                        if (Log.isLoggable(TAG, Log.WARN)) {
+                            Log.w(TAG, "Cookie rejected [" + formatCooke(cookie) + "] "
                                     + ex.getMessage());
                         }
                     }
                 }
             } catch (final MalformedCookieException ex) {
-                if (this.log.isWarnEnabled()) {
-                    this.log.warn("Invalid cookie header: \""
+                if (Log.isLoggable(TAG, Log.WARN)) {
+                    Log.w(TAG, "Invalid cookie header: \""
                             + header + "\". " + ex.getMessage());
                 }
             }

Modified: httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/conn/ssl/AbstractVerifierHC4.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/conn/ssl/AbstractVerifierHC4.java?rev=1573718&r1=1573717&r2=1573718&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/conn/ssl/AbstractVerifierHC4.java (original)
+++ httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/conn/ssl/AbstractVerifierHC4.java Mon Mar  3 20:02:31 2014
@@ -46,8 +46,8 @@ import javax.net.ssl.SSLException;
 import javax.net.ssl.SSLSession;
 import javax.net.ssl.SSLSocket;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import android.util.Log;
+
 import org.apache.http.annotation.Immutable;
 import org.apache.http.conn.util.InetAddressUtilsHC4;
 
@@ -79,7 +79,7 @@ public abstract class AbstractVerifierHC
         Arrays.sort(BAD_COUNTRY_2LDS);
     }
 
-    private final Log log = LogFactory.getLog(getClass());
+    private final static String TAG = "HttpClient";
 
     public AbstractVerifierHC4() {
         super();
@@ -389,7 +389,7 @@ public abstract class AbstractVerifierHC
             final InetAddress inetAddress = InetAddress.getByName(hostname);
             return inetAddress.getHostAddress();
         } catch (final UnknownHostException uhe) { // Should not happen, because we check for IPv6 address above
-            log.error("Unexpected error converting "+hostname, uhe);
+            Log.e(TAG, "Unexpected error converting "+hostname, uhe);
             return hostname;
         }
     }

Modified: httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/auth/BasicSchemeHC4.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/auth/BasicSchemeHC4.java?rev=1573718&r1=1573717&r2=1573718&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/auth/BasicSchemeHC4.java (original)
+++ httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/auth/BasicSchemeHC4.java Mon Mar  3 20:02:31 2014
@@ -28,7 +28,7 @@ package org.apache.http.impl.auth;
 
 import java.nio.charset.Charset;
 
-import org.apache.commons.codec.binary.Base64;
+import android.util.Base64;
 import org.apache.http.Consts;
 import org.apache.http.Header;
 import org.apache.http.HttpRequest;
@@ -53,7 +53,6 @@ import org.apache.http.util.EncodingUtil
 @NotThreadSafe
 public class BasicSchemeHC4 extends RFC2617SchemeHC4 {
 
-    private final Base64 base64codec;
     /** Whether the basic authentication process is complete */
     private boolean complete;
 
@@ -62,7 +61,6 @@ public class BasicSchemeHC4 extends RFC2
      */
     public BasicSchemeHC4(final Charset credentialsCharset) {
         super(credentialsCharset);
-        this.base64codec = new Base64();
         this.complete = false;
     }
 
@@ -77,7 +75,6 @@ public class BasicSchemeHC4 extends RFC2
     @Deprecated
     public BasicSchemeHC4(final ChallengeState challengeState) {
         super(challengeState);
-        this.base64codec = new Base64();
     }
 
     public BasicSchemeHC4() {
@@ -162,8 +159,9 @@ public class BasicSchemeHC4 extends RFC2
         tmp.append(":");
         tmp.append((credentials.getPassword() == null) ? "null" : credentials.getPassword());
 
-        final byte[] base64password = base64codec.encode(
-                EncodingUtils.getBytes(tmp.toString(), getCredentialsCharset(request)));
+        final byte[] base64password = Base64.encode(
+                EncodingUtils.getBytes(tmp.toString(), getCredentialsCharset(request)),
+                Base64.DEFAULT);
 
         final CharArrayBuffer buffer = new CharArrayBuffer(32);
         if (isProxy()) {
@@ -201,8 +199,9 @@ public class BasicSchemeHC4 extends RFC2
         tmp.append(":");
         tmp.append((credentials.getPassword() == null) ? "null" : credentials.getPassword());
 
-        final byte[] base64password = Base64.encodeBase64(
-                EncodingUtils.getBytes(tmp.toString(), charset), false);
+        final byte[] base64password = Base64.encode(
+                EncodingUtils.getBytes(tmp.toString(), charset),
+                Base64.DEFAULT);
 
         final CharArrayBuffer buffer = new CharArrayBuffer(32);
         if (proxy) {

Modified: httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/auth/HttpAuthenticator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/auth/HttpAuthenticator.java?rev=1573718&r1=1573717&r2=1573718&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/auth/HttpAuthenticator.java (original)
+++ httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/auth/HttpAuthenticator.java Mon Mar  3 20:02:31 2014
@@ -32,8 +32,8 @@ import java.util.Locale;
 import java.util.Map;
 import java.util.Queue;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import android.util.Log;
+
 import org.apache.http.Header;
 import org.apache.http.HttpException;
 import org.apache.http.HttpHost;
@@ -56,11 +56,10 @@ import org.apache.http.util.Asserts;
  */
 public class HttpAuthenticator {
 
-    private final Log log;
+    private final static String TAG = "HttpClient";
 
     public HttpAuthenticator(final Log log) {
         super();
-        this.log = log != null ? log : LogFactory.getLog(getClass());
     }
 
     public HttpAuthenticator() {
@@ -74,7 +73,7 @@ public class HttpAuthenticator {
             final AuthStateHC4 authState,
             final HttpContext context) {
         if (authStrategy.isAuthenticationRequested(host, response, context)) {
-            this.log.debug("Authentication required");
+            Log.d(TAG, "Authentication required");
             if (authState.getState() == AuthProtocolState.SUCCESS) {
                 authStrategy.authFailed(host, authState.getAuthScheme(), context);
             }
@@ -83,7 +82,7 @@ public class HttpAuthenticator {
             switch (authState.getState()) {
             case CHALLENGED:
             case HANDSHAKE:
-                this.log.debug("Authentication succeeded");
+                Log.d(TAG, "Authentication succeeded");
                 authState.setState(AuthProtocolState.SUCCESS);
                 authStrategy.authSucceeded(host, authState.getAuthScheme(), context);
                 break;
@@ -103,12 +102,12 @@ public class HttpAuthenticator {
             final AuthStateHC4 authState,
             final HttpContext context) {
         try {
-            if (this.log.isDebugEnabled()) {
-                this.log.debug(host.toHostString() + " requested authentication");
+            if (Log.isLoggable(TAG, Log.DEBUG)) {
+                Log.d(TAG, host.toHostString() + " requested authentication");
             }
             final Map<String, Header> challenges = authStrategy.getChallenges(host, response, context);
             if (challenges.isEmpty()) {
-                this.log.debug("Response contains no authentication challenges");
+                Log.d(TAG, "Response contains no authentication challenges");
                 return false;
             }
 
@@ -122,7 +121,7 @@ public class HttpAuthenticator {
             case CHALLENGED:
             case HANDSHAKE:
                 if (authScheme == null) {
-                    this.log.debug("Auth scheme is null");
+                    Log.d(TAG, "Auth scheme is null");
                     authStrategy.authFailed(host, null, context);
                     authState.reset();
                     authState.setState(AuthProtocolState.FAILURE);
@@ -133,10 +132,10 @@ public class HttpAuthenticator {
                     final String id = authScheme.getSchemeName();
                     final Header challenge = challenges.get(id.toLowerCase(Locale.US));
                     if (challenge != null) {
-                        this.log.debug("Authorization challenge processed");
+                        Log.d(TAG, "Authorization challenge processed");
                         authScheme.processChallenge(challenge);
                         if (authScheme.isComplete()) {
-                            this.log.debug("Authentication failed");
+                            Log.d(TAG, "Authentication failed");
                             authStrategy.authFailed(host, authState.getAuthScheme(), context);
                             authState.reset();
                             authState.setState(AuthProtocolState.FAILURE);
@@ -153,8 +152,8 @@ public class HttpAuthenticator {
             }
             final Queue<AuthOption> authOptions = authStrategy.select(challenges, host, response, context);
             if (authOptions != null && !authOptions.isEmpty()) {
-                if (this.log.isDebugEnabled()) {
-                    this.log.debug("Selected authentication options: " + authOptions);
+                if (Log.isLoggable(TAG, Log.DEBUG)) {
+                    Log.d(TAG, "Selected authentication options: " + authOptions);
                 }
                 authState.setState(AuthProtocolState.CHALLENGED);
                 authState.update(authOptions);
@@ -163,8 +162,8 @@ public class HttpAuthenticator {
                 return false;
             }
         } catch (final MalformedChallengeException ex) {
-            if (this.log.isWarnEnabled()) {
-                this.log.warn("Malformed challenge: " +  ex.getMessage());
+            if (Log.isLoggable(TAG, Log.WARN)) {
+                Log.w(TAG, "Malformed challenge: " +  ex.getMessage());
             }
             authState.reset();
             return false;
@@ -194,8 +193,8 @@ public class HttpAuthenticator {
                     authScheme = authOption.getAuthScheme();
                     creds = authOption.getCredentials();
                     authState.update(authScheme, creds);
-                    if (this.log.isDebugEnabled()) {
-                        this.log.debug("Generating response to an authentication challenge using "
+                    if (Log.isLoggable(TAG, Log.DEBUG)) {
+                        Log.d(TAG, "Generating response to an authentication challenge using "
                                 + authScheme.getSchemeName() + " scheme");
                     }
                     try {
@@ -203,8 +202,8 @@ public class HttpAuthenticator {
                         request.addHeader(header);
                         break;
                     } catch (final AuthenticationException ex) {
-                        if (this.log.isWarnEnabled()) {
-                            this.log.warn(authScheme + " authentication error: " + ex.getMessage());
+                        if (Log.isLoggable(TAG, Log.WARN)) {
+                            Log.w(TAG, authScheme + " authentication error: " + ex.getMessage());
                         }
                     }
                 }
@@ -218,8 +217,8 @@ public class HttpAuthenticator {
                 final Header header = doAuth(authScheme, creds, request, context);
                 request.addHeader(header);
             } catch (final AuthenticationException ex) {
-                if (this.log.isErrorEnabled()) {
-                    this.log.error(authScheme + " authentication error: " + ex.getMessage());
+                if (Log.isLoggable(TAG, Log.ERROR)) {
+                    Log.e(TAG, authScheme + " authentication error: " + ex.getMessage());
                 }
             }
         }

Modified: httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java?rev=1573718&r1=1573717&r2=1573718&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java (original)
+++ httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java Mon Mar  3 20:02:31 2014
@@ -35,10 +35,11 @@ import java.util.Locale;
 import javax.crypto.Cipher;
 import javax.crypto.spec.SecretKeySpec;
 
-import org.apache.commons.codec.binary.Base64;
 import org.apache.http.annotation.NotThreadSafe;
 import org.apache.http.util.EncodingUtils;
 
+import android.util.Base64;
+
 /**
  * Provides an implementation for NTLMv1, NTLMv2, and NTLM2 Session forms of the NTLM
  * authentication protocol.
@@ -848,8 +849,8 @@ final class NTLMEngineImpl implements NT
 
         /** Constructor to use when message contents are known */
         NTLMMessage(final String messageBody, final int expectedType) throws NTLMEngineException {
-            messageContents = Base64.decodeBase64(EncodingUtils.getBytes(messageBody,
-                    DEFAULT_CHARSET));
+            messageContents = Base64.decode(EncodingUtils.getBytes(messageBody, DEFAULT_CHARSET),
+                    Base64.DEFAULT);
             // Look for NTLM message
             if (messageContents.length < SIGNATURE.length) {
                 throw new NTLMEngineException("NTLM message decoding error - packet too short");
@@ -988,7 +989,7 @@ final class NTLMEngineImpl implements NT
             } else {
                 resp = messageContents;
             }
-            return EncodingUtils.getAsciiString(Base64.encodeBase64(resp));
+            return EncodingUtils.getAsciiString(Base64.encode(resp, Base64.DEFAULT));
         }
 
     }

Modified: httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/client/AuthenticationStrategyImpl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/client/AuthenticationStrategyImpl.java?rev=1573718&r1=1573717&r2=1573718&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/client/AuthenticationStrategyImpl.java (original)
+++ httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/client/AuthenticationStrategyImpl.java Mon Mar  3 20:02:31 2014
@@ -37,8 +37,8 @@ import java.util.Locale;
 import java.util.Map;
 import java.util.Queue;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import android.util.Log;
+
 import org.apache.http.FormattedHeader;
 import org.apache.http.Header;
 import org.apache.http.HttpHost;
@@ -65,7 +65,7 @@ import org.apache.http.util.CharArrayBuf
 @Immutable
 abstract class AuthenticationStrategyImpl implements AuthenticationStrategy {
 
-    private final Log log = LogFactory.getLog(getClass());
+    private final static String TAG = "HttpClient";
 
     private static final List<String> DEFAULT_SCHEME_PRIORITY =
         Collections.unmodifiableList(Arrays.asList(AuthSchemes.SPNEGO,
@@ -144,12 +144,12 @@ abstract class AuthenticationStrategyImp
         final Queue<AuthOption> options = new LinkedList<AuthOption>();
         final Lookup<AuthSchemeProvider> registry = clientContext.getAuthSchemeRegistry();
         if (registry == null) {
-            this.log.debug("Auth scheme registry not set in the context");
+            Log.d(TAG, "Auth scheme registry not set in the context");
             return options;
         }
         final CredentialsProvider credsProvider = clientContext.getCredentialsProvider();
         if (credsProvider == null) {
-            this.log.debug("Credentials provider not set in the context");
+            Log.d(TAG, "Credentials provider not set in the context");
             return options;
         }
         final RequestConfig config = clientContext.getRequestConfig();
@@ -157,8 +157,8 @@ abstract class AuthenticationStrategyImp
         if (authPrefs == null) {
             authPrefs = DEFAULT_SCHEME_PRIORITY;
         }
-        if (this.log.isDebugEnabled()) {
-            this.log.debug("Authentication schemes in the order of preference: " + authPrefs);
+        if (Log.isLoggable(TAG, Log.DEBUG)) {
+            Log.d(TAG, "Authentication schemes in the order of preference: " + authPrefs);
         }
 
         for (final String id: authPrefs) {
@@ -166,8 +166,8 @@ abstract class AuthenticationStrategyImp
             if (challenge != null) {
                 final AuthSchemeProvider authSchemeProvider = registry.lookup(id);
                 if (authSchemeProvider == null) {
-                    if (this.log.isWarnEnabled()) {
-                        this.log.warn("Authentication scheme " + id + " not supported");
+                    if (Log.isLoggable(TAG, Log.WARN)) {
+                        Log.w(TAG, "Authentication scheme " + id + " not supported");
                         // Try again
                     }
                     continue;
@@ -186,8 +186,8 @@ abstract class AuthenticationStrategyImp
                     options.add(new AuthOption(authScheme, credentials));
                 }
             } else {
-                if (this.log.isDebugEnabled()) {
-                    this.log.debug("Challenge for " + id + " authentication scheme not available");
+                if (Log.isLoggable(TAG, Log.DEBUG)) {
+                    Log.d(TAG, "Challenge for " + id + " authentication scheme not available");
                     // Try again
                 }
             }
@@ -209,8 +209,8 @@ abstract class AuthenticationStrategyImp
                 authCache = new BasicAuthCache();
                 clientContext.setAuthCache(authCache);
             }
-            if (this.log.isDebugEnabled()) {
-                this.log.debug("Caching '" + authScheme.getSchemeName() +
+            if (Log.isLoggable(TAG, Log.DEBUG)) {
+                Log.d(TAG, "Caching '" + authScheme.getSchemeName() +
                         "' auth scheme for " + authhost);
             }
             authCache.put(authhost, authScheme);
@@ -235,8 +235,8 @@ abstract class AuthenticationStrategyImp
 
         final AuthCache authCache = clientContext.getAuthCache();
         if (authCache != null) {
-            if (this.log.isDebugEnabled()) {
-                this.log.debug("Clearing cached auth scheme for " + authhost);
+            if (Log.isLoggable(TAG, Log.DEBUG)) {
+                Log.d(TAG, "Clearing cached auth scheme for " + authhost);
             }
             authCache.remove(authhost);
         }

Modified: httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/client/CloseableHttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/client/CloseableHttpClient.java?rev=1573718&r1=1573717&r2=1573718&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/client/CloseableHttpClient.java (original)
+++ httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/client/CloseableHttpClient.java Mon Mar  3 20:02:31 2014
@@ -32,8 +32,8 @@ import java.io.IOException;
 import java.lang.reflect.UndeclaredThrowableException;
 import java.net.URI;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import android.util.Log;
+
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpHost;
 import org.apache.http.HttpRequest;
@@ -57,7 +57,7 @@ import org.apache.http.util.EntityUtilsH
 @ThreadSafe
 public abstract class CloseableHttpClient implements HttpClient, Closeable {
 
-    private final Log log = LogFactory.getLog(getClass());
+    private final static String TAG = "HttpClient";
 
     protected abstract CloseableHttpResponse doExecute(HttpHost target, HttpRequest request,
             HttpContext context) throws IOException, ClientProtocolException;
@@ -223,7 +223,7 @@ public abstract class CloseableHttpClien
             } catch (final Exception t2) {
                 // Log this exception. The original exception is more
                 // important and will be thrown to the caller.
-                this.log.warn("Error consuming content after an exception.", t2);
+                Log.w(TAG, "Error consuming content after an exception.", t2);
             }
             if (t instanceof RuntimeException) {
                 throw (RuntimeException) t;

Modified: httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/client/DefaultRedirectStrategy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/client/DefaultRedirectStrategy.java?rev=1573718&r1=1573717&r2=1573718&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/client/DefaultRedirectStrategy.java (original)
+++ httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/client/DefaultRedirectStrategy.java Mon Mar  3 20:02:31 2014
@@ -31,8 +31,8 @@ import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.Locale;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import android.util.Log;
+
 import org.apache.http.Header;
 import org.apache.http.HttpHost;
 import org.apache.http.HttpRequest;
@@ -72,7 +72,7 @@ import org.apache.http.util.TextUtils;
 @Immutable
 public class DefaultRedirectStrategy implements RedirectStrategy {
 
-    private final Log log = LogFactory.getLog(getClass());
+    private final static String TAG = "HttpClient";
 
     /**
      * @deprecated (4.3) use {@link org.apache.http.client.protocol.HttpClientContext#REDIRECT_LOCATIONS}.
@@ -136,8 +136,8 @@ public class DefaultRedirectStrategy imp
                     + " but no location header");
         }
         final String location = locationHeader.getValue();
-        if (this.log.isDebugEnabled()) {
-            this.log.debug("Redirect requested to location '" + location + "'");
+        if (Log.isLoggable(TAG, Log.DEBUG)) {
+            Log.d(TAG, "Redirect requested to location '" + location + "'");
         }
 
         final RequestConfig config = clientContext.getRequestConfig();

Modified: httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/client/InternalHttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/client/InternalHttpClient.java?rev=1573718&r1=1573717&r2=1573718&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/client/InternalHttpClient.java (original)
+++ httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/client/InternalHttpClient.java Mon Mar  3 20:02:31 2014
@@ -32,8 +32,8 @@ import java.io.IOException;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import android.util.Log;
+
 import org.apache.http.HttpException;
 import org.apache.http.HttpHost;
 import org.apache.http.HttpRequest;
@@ -77,7 +77,7 @@ import org.apache.http.util.Asserts;
 @SuppressWarnings("deprecation")
 class InternalHttpClient extends CloseableHttpClient {
 
-    private final Log log = LogFactory.getLog(getClass());
+    private final static String TAG = "HttpClient";
 
     private final ClientExecChain execChain;
     private final HttpClientConnectionManager connManager;
@@ -196,7 +196,7 @@ class InternalHttpClient extends Closeab
                 try {
                     closeable.close();
                 } catch (final IOException ex) {
-                    this.log.error(ex.getMessage(), ex);
+                    Log.e(TAG, ex.getMessage(), ex);
                 }
             }
         }

Modified: httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/BasicHttpClientConnectionManager.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/BasicHttpClientConnectionManager.java?rev=1573718&r1=1573717&r2=1573718&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/BasicHttpClientConnectionManager.java (original)
+++ httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/BasicHttpClientConnectionManager.java Mon Mar  3 20:02:31 2014
@@ -33,8 +33,8 @@ import java.net.InetSocketAddress;
 import java.util.Date;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import android.util.Log;
+
 import org.apache.http.HttpClientConnection;
 import org.apache.http.HttpHost;
 import org.apache.http.annotation.GuardedBy;
@@ -78,7 +78,7 @@ import org.apache.http.util.LangUtils;
 @ThreadSafe
 public class BasicHttpClientConnectionManager implements HttpClientConnectionManager, Closeable {
 
-    private final Log log = LogFactory.getLog(getClass());
+    private final static String TAG = "HttpClient";
 
     private final HttpClientConnectionOperator connectionOperator;
     private final HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory;
@@ -204,12 +204,12 @@ public class BasicHttpClientConnectionMa
 
     private void closeConnection() {
         if (this.conn != null) {
-            this.log.debug("Closing connection");
+            Log.d(TAG, "Closing connection");
             try {
                 this.conn.close();
             } catch (final IOException iox) {
-                if (this.log.isDebugEnabled()) {
-                    this.log.debug("I/O exception closing connection", iox);
+                if (Log.isLoggable(TAG, Log.DEBUG)) {
+                    Log.d(TAG, "I/O exception closing connection", iox);
                 }
             }
             this.conn = null;
@@ -218,12 +218,12 @@ public class BasicHttpClientConnectionMa
 
     private void shutdownConnection() {
         if (this.conn != null) {
-            this.log.debug("Shutting down connection");
+            Log.d(TAG, "Shutting down connection");
             try {
                 this.conn.shutdown();
             } catch (final IOException iox) {
-                if (this.log.isDebugEnabled()) {
-                    this.log.debug("I/O exception shutting down connection", iox);
+                if (Log.isLoggable(TAG, Log.DEBUG)) {
+                    Log.d(TAG, "I/O exception shutting down connection", iox);
                 }
             }
             this.conn = null;
@@ -232,8 +232,8 @@ public class BasicHttpClientConnectionMa
 
     private void checkExpiry() {
         if (this.conn != null && System.currentTimeMillis() >= this.expiry) {
-            if (this.log.isDebugEnabled()) {
-                this.log.debug("Connection expired @ " + new Date(this.expiry));
+            if (Log.isLoggable(TAG, Log.DEBUG)) {
+                Log.d(TAG, "Connection expired @ " + new Date(this.expiry));
             }
             closeConnection();
         }
@@ -241,8 +241,8 @@ public class BasicHttpClientConnectionMa
 
     synchronized HttpClientConnection getConnection(final HttpRoute route, final Object state) {
         Asserts.check(!this.shutdown, "Connection manager has been shut down");
-        if (this.log.isDebugEnabled()) {
-            this.log.debug("Get connection for route " + route);
+        if (Log.isLoggable(TAG, Log.DEBUG)) {
+            Log.d(TAG, "Get connection for route " + route);
         }
         Asserts.check(!this.leased, "Connection is still allocated");
         if (!LangUtils.equals(this.route, route) || !LangUtils.equals(this.state, state)) {
@@ -264,8 +264,8 @@ public class BasicHttpClientConnectionMa
             final long keepalive, final TimeUnit tunit) {
         Args.notNull(conn, "Connection");
         Asserts.check(conn == this.conn, "Connection not obtained from this manager");
-        if (this.log.isDebugEnabled()) {
-            this.log.debug("Releasing connection " + conn);
+        if (Log.isLoggable(TAG, Log.DEBUG)) {
+            Log.d(TAG, "Releasing connection " + conn);
         }
         if (this.shutdown) {
             shutdownConnection();
@@ -280,14 +280,14 @@ public class BasicHttpClientConnectionMa
                 this.expiry = Long.MAX_VALUE;
             } else {
                 this.state = state;
-                if (this.log.isDebugEnabled()) {
+                if (Log.isLoggable(TAG, Log.DEBUG)) {
                     final String s;
                     if (keepalive > 0) {
                         s = "for " + keepalive + " " + tunit;
                     } else {
                         s = "indefinitely";
                     }
-                    this.log.debug("Connection can be kept alive " + s);
+                    Log.d(TAG, "Connection can be kept alive " + s);
                 }
                 if (keepalive > 0) {
                     this.expiry = this.updated + tunit.toMillis(keepalive);

Modified: httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/CPool.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/CPool.java?rev=1573718&r1=1573717&r2=1573718&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/CPool.java (original)
+++ httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/CPool.java Mon Mar  3 20:02:31 2014
@@ -29,8 +29,8 @@ package org.apache.http.impl.conn;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicLong;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import android.util.Log;
+
 import org.apache.http.annotation.ThreadSafe;
 import org.apache.http.conn.ManagedHttpClientConnection;
 import org.apache.http.conn.routing.HttpRoute;
@@ -45,7 +45,7 @@ class CPool extends AbstractConnPool<Htt
 
     private static final AtomicLong COUNTER = new AtomicLong();
 
-    private final Log log = LogFactory.getLog(CPool.class);
+    private final static String TAG = "HttpClient";
     private final long timeToLive;
     private final TimeUnit tunit;
 
@@ -61,7 +61,7 @@ class CPool extends AbstractConnPool<Htt
     @Override
     protected CPoolEntry createEntry(final HttpRoute route, final ManagedHttpClientConnection conn) {
         final String id = Long.toString(COUNTER.getAndIncrement());
-        return new CPoolEntry(this.log, id, route, conn, this.timeToLive, this.tunit);
+        return new CPoolEntry(id, route, conn, this.timeToLive, this.tunit);
     }
 
 }

Modified: httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/CPoolEntry.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/CPoolEntry.java?rev=1573718&r1=1573717&r2=1573718&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/CPoolEntry.java (original)
+++ httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/CPoolEntry.java Mon Mar  3 20:02:31 2014
@@ -30,7 +30,7 @@ import java.io.IOException;
 import java.util.Date;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.commons.logging.Log;
+import android.util.Log;
 import org.apache.http.HttpClientConnection;
 import org.apache.http.annotation.ThreadSafe;
 import org.apache.http.conn.ManagedHttpClientConnection;
@@ -43,17 +43,16 @@ import org.apache.http.pool.PoolEntry;
 @ThreadSafe
 class CPoolEntry extends PoolEntry<HttpRoute, ManagedHttpClientConnection> {
 
-    private final Log log;
+    private final static String TAG = "HttpClient";
+
     private volatile boolean routeComplete;
 
     public CPoolEntry(
-            final Log log,
             final String id,
             final HttpRoute route,
             final ManagedHttpClientConnection conn,
             final long timeToLive, final TimeUnit tunit) {
         super(id, route, conn, timeToLive, tunit);
-        this.log = log;
     }
 
     public void markRouteComplete() {
@@ -77,8 +76,8 @@ class CPoolEntry extends PoolEntry<HttpR
     @Override
     public boolean isExpired(final long now) {
         final boolean expired = super.isExpired(now);
-        if (expired && this.log.isDebugEnabled()) {
-            this.log.debug("Connection " + this + " expired @ " + new Date(getExpiry()));
+        if (expired && Log.isLoggable(TAG, Log.DEBUG)) {
+            Log.d(TAG, "Connection " + this + " expired @ " + new Date(getExpiry()));
         }
         return expired;
     }
@@ -94,7 +93,7 @@ class CPoolEntry extends PoolEntry<HttpR
         try {
             closeConnection();
         } catch (final IOException ex) {
-            this.log.debug("I/O error closing connection", ex);
+            Log.d(TAG, "I/O error closing connection", ex);
         }
     }
 

Modified: httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/DefaultHttpResponseParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/DefaultHttpResponseParser.java?rev=1573718&r1=1573717&r2=1573718&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/DefaultHttpResponseParser.java (original)
+++ httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/DefaultHttpResponseParser.java Mon Mar  3 20:02:31 2014
@@ -29,8 +29,8 @@ package org.apache.http.impl.conn;
 
 import java.io.IOException;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import android.util.Log;
+
 import org.apache.http.HttpException;
 import org.apache.http.HttpResponse;
 import org.apache.http.HttpResponseFactory;
@@ -58,7 +58,7 @@ import org.apache.http.util.CharArrayBuf
 @NotThreadSafe
 public class DefaultHttpResponseParser extends AbstractMessageParserHC4<HttpResponse> {
 
-    private final Log log = LogFactory.getLog(getClass());
+    private final static String TAG = "HttpClient";
 
     private final HttpResponseFactory responseFactory;
     private final CharArrayBuffer lineBuf;
@@ -151,8 +151,8 @@ public class DefaultHttpResponseParser e
                 throw new ProtocolException("The server failed to respond with a " +
                         "valid HTTP response");
             }
-            if (this.log.isDebugEnabled()) {
-                this.log.debug("Garbage in response: " + this.lineBuf.toString());
+            if (Log.isLoggable(TAG, Log.DEBUG)) {
+                Log.d(TAG, "Garbage in response: " + this.lineBuf.toString());
             }
             count++;
         } while(true);

Modified: httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/HttpClientConnectionOperator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/HttpClientConnectionOperator.java?rev=1573718&r1=1573717&r2=1573718&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/HttpClientConnectionOperator.java (original)
+++ httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/HttpClientConnectionOperator.java Mon Mar  3 20:02:31 2014
@@ -34,8 +34,8 @@ import java.net.Socket;
 import java.net.SocketTimeoutException;
 import java.util.Arrays;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import android.util.Log;
+
 import org.apache.http.HttpHost;
 import org.apache.http.annotation.Immutable;
 import org.apache.http.client.protocol.HttpClientContext;
@@ -57,7 +57,7 @@ class HttpClientConnectionOperator {
 
     static final String SOCKET_FACTORY_REGISTRY = "http.socket-factory-registry";
 
-    private final Log log = LogFactory.getLog(getClass());
+    private final static String TAG = "HttpClient";
 
     private final Lookup<ConnectionSocketFactory> socketFactoryRegistry;
     private final SchemePortResolver schemePortResolver;
@@ -123,8 +123,8 @@ class HttpClientConnectionOperator {
             conn.bind(sock);
 
             final InetSocketAddress remoteAddress = new InetSocketAddress(address, port);
-            if (this.log.isDebugEnabled()) {
-                this.log.debug("Connecting to " + remoteAddress);
+            if (Log.isLoggable(TAG, Log.DEBUG)) {
+                Log.d(TAG, "Connecting to " + remoteAddress);
             }
             try {
                 sock.setSoTimeout(socketConfig.getSoTimeout());
@@ -137,8 +137,8 @@ class HttpClientConnectionOperator {
                     sock.setSoLinger(linger > 0, linger);
                 }
                 conn.bind(sock);
-                if (this.log.isDebugEnabled()) {
-                    this.log.debug("Connection established " + conn);
+                if (Log.isLoggable(TAG, Log.DEBUG)) {
+                    Log.d(TAG, "Connection established " + conn);
                 }
                 return;
             } catch (final SocketTimeoutException ex) {
@@ -160,8 +160,8 @@ class HttpClientConnectionOperator {
                     }
                 }
             }
-            if (this.log.isDebugEnabled()) {
-                this.log.debug("Connect to " + remoteAddress + " timed out. " +
+            if (Log.isLoggable(TAG, Log.DEBUG)) {
+                Log.d(TAG, "Connect to " + remoteAddress + " timed out. " +
                         "Connection will be retried using another IP address");
             }
         }

Modified: httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/InMemoryDnsResolver.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/InMemoryDnsResolver.java?rev=1573718&r1=1573717&r2=1573718&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/InMemoryDnsResolver.java (original)
+++ httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/InMemoryDnsResolver.java Mon Mar  3 20:02:31 2014
@@ -32,8 +32,8 @@ import java.util.Arrays;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import android.util.Log;
+
 import org.apache.http.conn.DnsResolver;
 import org.apache.http.util.Args;
 
@@ -45,7 +45,7 @@ import org.apache.http.util.Args;
 public class InMemoryDnsResolver implements DnsResolver {
 
     /** Logger associated to this class. */
-    private final Log log = LogFactory.getLog(InMemoryDnsResolver.class);
+    private final static String TAG = "HttpClient";
 
     /**
      * In-memory collection that will hold the associations between a host name
@@ -82,8 +82,8 @@ public class InMemoryDnsResolver impleme
      */
     public InetAddress[] resolve(final String host) throws UnknownHostException {
         final InetAddress[] resolvedAddresses = dnsMap.get(host);
-        if (log.isInfoEnabled()) {
-            log.info("Resolving " + host + " to " + Arrays.deepToString(resolvedAddresses));
+        if (Log.isLoggable(TAG, Log.INFO)) {
+            Log.i(TAG, "Resolving " + host + " to " + Arrays.deepToString(resolvedAddresses));
         }
         if(resolvedAddresses == null){
             throw new UnknownHostException(host + " cannot be resolved");

Modified: httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/LoggingManagedHttpClientConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/LoggingManagedHttpClientConnection.java?rev=1573718&r1=1573717&r2=1573718&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/LoggingManagedHttpClientConnection.java (original)
+++ httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/LoggingManagedHttpClientConnection.java Mon Mar  3 20:02:31 2014
@@ -27,7 +27,7 @@
 
 package org.apache.http.impl.conn;
 
-import org.apache.commons.logging.Log;
+import android.util.Log;
 import org.apache.http.Header;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpResponse;
@@ -47,15 +47,13 @@ import java.nio.charset.CharsetEncoder;
 @NotThreadSafe
 class LoggingManagedHttpClientConnection extends DefaultManagedHttpClientConnection {
 
-    private final Log log;
-    private final Log headerlog;
+    private final static String TAG = "HttpClient";
+    private final static String HEADER_TAG = "headers";
+
     private final WireHC4 wire;
 
     public LoggingManagedHttpClientConnection(
             final String id,
-            final Log log,
-            final Log headerlog,
-            final Log wirelog,
             final int buffersize,
             final int fragmentSizeHint,
             final CharsetDecoder chardecoder,
@@ -68,23 +66,21 @@ class LoggingManagedHttpClientConnection
         super(id, buffersize, fragmentSizeHint, chardecoder, charencoder,
                 constraints, incomingContentStrategy, outgoingContentStrategy,
                 requestWriterFactory, responseParserFactory);
-        this.log = log;
-        this.headerlog = headerlog;
-        this.wire = new WireHC4(wirelog, id);
+        this.wire = new WireHC4(id);
     }
 
     @Override
     public void close() throws IOException {
-        if (this.log.isDebugEnabled()) {
-            this.log.debug(getId() + ": Close connection");
+        if (Log.isLoggable(TAG, Log.DEBUG)) {
+            Log.d(TAG, getId() + ": Close connection");
         }
         super.close();
     }
 
     @Override
     public void shutdown() throws IOException {
-        if (this.log.isDebugEnabled()) {
-            this.log.debug(getId() + ": Shutdown connection");
+        if (Log.isLoggable(TAG, Log.DEBUG)) {
+            Log.d(TAG, getId() + ": Shutdown connection");
         }
         super.shutdown();
     }
@@ -109,22 +105,22 @@ class LoggingManagedHttpClientConnection
 
     @Override
     protected void onResponseReceived(final HttpResponse response) {
-        if (response != null && this.headerlog.isDebugEnabled()) {
-            this.headerlog.debug(getId() + " << " + response.getStatusLine().toString());
+        if (response != null && Log.isLoggable(HEADER_TAG, Log.DEBUG)) {
+            Log.d(HEADER_TAG, getId() + " << " + response.getStatusLine().toString());
             final Header[] headers = response.getAllHeaders();
             for (final Header header : headers) {
-                this.headerlog.debug(getId() + " << " + header.toString());
+                Log.d(HEADER_TAG, getId() + " << " + header.toString());
             }
         }
     }
 
     @Override
     protected void onRequestSubmitted(final HttpRequest request) {
-        if (request != null && this.headerlog.isDebugEnabled()) {
-            this.headerlog.debug(getId() + " >> " + request.getRequestLine().toString());
+        if (request != null && Log.isLoggable(HEADER_TAG, Log.DEBUG)) {
+            Log.d(HEADER_TAG, getId() + " >> " + request.getRequestLine().toString());
             final Header[] headers = request.getAllHeaders();
             for (final Header header : headers) {
-                this.headerlog.debug(getId() + " >> " + header.toString());
+                Log.d(HEADER_TAG, getId() + " >> " + header.toString());
             }
         }
     }

Modified: httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/ManagedHttpClientConnectionFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/ManagedHttpClientConnectionFactory.java?rev=1573718&r1=1573717&r2=1573718&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/ManagedHttpClientConnectionFactory.java (original)
+++ httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/ManagedHttpClientConnectionFactory.java Mon Mar  3 20:02:31 2014
@@ -33,8 +33,6 @@ import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CodingErrorAction;
 import java.util.concurrent.atomic.AtomicLong;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpResponse;
 import org.apache.http.annotation.Immutable;
@@ -58,9 +56,7 @@ public class ManagedHttpClientConnection
 
     public static final ManagedHttpClientConnectionFactory INSTANCE = new ManagedHttpClientConnectionFactory();
 
-    private final Log log = LogFactory.getLog(DefaultManagedHttpClientConnection.class);
-    private final Log headerlog = LogFactory.getLog("org.apache.http.headers");
-    private final Log wirelog = LogFactory.getLog("org.apache.http.wire");
+    private final static String TAG = "HttpClient";
 
     private final HttpMessageWriterFactory<HttpRequest> requestWriterFactory;
     private final HttpMessageParserFactory<HttpResponse> responseParserFactory;
@@ -104,9 +100,6 @@ public class ManagedHttpClientConnection
         final String id = "http-outgoing-" + Long.toString(COUNTER.getAndIncrement());
         return new LoggingManagedHttpClientConnection(
                 id,
-                log,
-                headerlog,
-                wirelog,
                 cconfig.getBufferSize(),
                 cconfig.getFragmentSizeHint(),
                 chardecoder,

Modified: httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java?rev=1573718&r1=1573717&r2=1573718&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java (original)
+++ httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java Mon Mar  3 20:02:31 2014
@@ -36,8 +36,8 @@ import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import android.util.Log;
+
 import org.apache.http.HttpClientConnection;
 import org.apache.http.HttpHost;
 import org.apache.http.annotation.ThreadSafe;
@@ -86,7 +86,7 @@ import org.apache.http.util.Asserts;
 public class PoolingHttpClientConnectionManager
     implements HttpClientConnectionManager, ConnPoolControl<HttpRoute>, Closeable {
 
-    private final Log log = LogFactory.getLog(getClass());
+    private final static String TAG = "HttpClient";
 
     private final ConfigData configData;
     private final CPool pool;
@@ -211,8 +211,8 @@ public class PoolingHttpClientConnection
             final HttpRoute route,
             final Object state) {
         Args.notNull(route, "HTTP route");
-        if (this.log.isDebugEnabled()) {
-            this.log.debug("Connection request: " + format(route, state) + formatStats(route));
+        if (Log.isLoggable(TAG, Log.DEBUG)) {
+            Log.d(TAG, "Connection request: " + format(route, state) + formatStats(route));
         }
         final Future<CPoolEntry> future = this.pool.lease(route, state, null);
         return new ConnectionRequest() {
@@ -242,8 +242,8 @@ public class PoolingHttpClientConnection
                 throw new InterruptedException();
             }
             Asserts.check(entry.getConnection() != null, "Pool entry with no connection");
-            if (this.log.isDebugEnabled()) {
-                this.log.debug("Connection leased: " + format(entry) + formatStats(entry.getRoute()));
+            if (Log.isLoggable(TAG, Log.DEBUG)) {
+                Log.d(TAG, "Connection leased: " + format(entry) + formatStats(entry.getRoute()));
             }
             return CPoolProxy.newProxy(entry);
         } catch (final TimeoutException ex) {
@@ -266,20 +266,20 @@ public class PoolingHttpClientConnection
                 if (conn.isOpen()) {
                     entry.setState(state);
                     entry.updateExpiry(keepalive, tunit != null ? tunit : TimeUnit.MILLISECONDS);
-                    if (this.log.isDebugEnabled()) {
+                    if (Log.isLoggable(TAG, Log.DEBUG)) {
                         final String s;
                         if (keepalive > 0) {
                             s = "for " + (double) keepalive / 1000 + " seconds";
                         } else {
                             s = "indefinitely";
                         }
-                        this.log.debug("Connection " + format(entry) + " can be kept alive " + s);
+                        Log.d(TAG, "Connection " + format(entry) + " can be kept alive " + s);
                     }
                 }
             } finally {
                 this.pool.release(entry, conn.isOpen() && entry.isRouteComplete());
-                if (this.log.isDebugEnabled()) {
-                    this.log.debug("Connection released: " + format(entry) + formatStats(entry.getRoute()));
+                if (Log.isLoggable(TAG, Log.DEBUG)) {
+                    Log.d(TAG, "Connection released: " + format(entry) + formatStats(entry.getRoute()));
                 }
             }
         }
@@ -342,24 +342,24 @@ public class PoolingHttpClientConnection
     }
 
     public void shutdown() {
-        this.log.debug("Connection manager is shutting down");
+        Log.d(TAG, "Connection manager is shutting down");
         try {
             this.pool.shutdown();
         } catch (final IOException ex) {
-            this.log.debug("I/O exception shutting down connection manager", ex);
+            Log.d(TAG, "I/O exception shutting down connection manager", ex);
         }
-        this.log.debug("Connection manager shut down");
+        Log.d(TAG, "Connection manager shut down");
     }
 
     public void closeIdleConnections(final long idleTimeout, final TimeUnit tunit) {
-        if (this.log.isDebugEnabled()) {
-            this.log.debug("Closing connections idle longer than " + idleTimeout + " " + tunit);
+        if (Log.isLoggable(TAG, Log.DEBUG)) {
+            Log.d(TAG, "Closing connections idle longer than " + idleTimeout + " " + tunit);
         }
         this.pool.closeIdle(idleTimeout, tunit);
     }
 
     public void closeExpiredConnections() {
-        this.log.debug("Closing expired connections");
+        Log.d(TAG, "Closing expired connections");
         this.pool.closeExpired();
     }
 

Modified: httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/WireHC4.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/WireHC4.java?rev=1573718&r1=1573717&r2=1573718&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/WireHC4.java (original)
+++ httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/conn/WireHC4.java Mon Mar  3 20:02:31 2014
@@ -30,7 +30,7 @@ import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 
-import org.apache.commons.logging.Log;
+import android.util.Log;
 import org.apache.http.annotation.Immutable;
 import org.apache.http.util.Args;
 
@@ -43,21 +43,16 @@ import org.apache.http.util.Args;
 @Immutable
 public class WireHC4 {
 
-    private final Log log;
+    private final static String TAG = "wire";
     private final String id;
 
     /**
      * @since 4.3
      */
-    public WireHC4(final Log log, final String id) {
-        this.log = log;
+    public WireHC4(final String id) {
         this.id = id;
     }
 
-    public WireHC4(final Log log) {
-        this(log, "");
-    }
-
     private void wire(final String header, final InputStream instream)
       throws IOException {
         final StringBuilder buffer = new StringBuilder();
@@ -69,7 +64,7 @@ public class WireHC4 {
                     buffer.append("[\\n]\"");
                     buffer.insert(0, "\"");
                     buffer.insert(0, header);
-                    log.debug(id + " " + buffer.toString());
+                    Log.d(TAG, id + " " + buffer.toString());
                     buffer.setLength(0);
             } else if ((ch < 32) || (ch > 127)) {
                 buffer.append("[0x");
@@ -83,13 +78,13 @@ public class WireHC4 {
             buffer.append('\"');
             buffer.insert(0, '\"');
             buffer.insert(0, header);
-            log.debug(id + " " + buffer.toString());
+            Log.d(TAG, id + " " + buffer.toString());
         }
     }
 
 
     public boolean enabled() {
-        return log.isDebugEnabled();
+        return Log.isLoggable(TAG, Log.DEBUG);
     }
 
     public void output(final InputStream outstream)

Modified: httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/execchain/ConnectionHolder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/execchain/ConnectionHolder.java?rev=1573718&r1=1573717&r2=1573718&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/execchain/ConnectionHolder.java (original)
+++ httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/execchain/ConnectionHolder.java Mon Mar  3 20:02:31 2014
@@ -31,7 +31,7 @@ import java.io.Closeable;
 import java.io.IOException;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.commons.logging.Log;
+import android.util.Log;
 import org.apache.http.HttpClientConnection;
 import org.apache.http.annotation.ThreadSafe;
 import org.apache.http.concurrent.Cancellable;
@@ -46,7 +46,7 @@ import org.apache.http.conn.HttpClientCo
 @ThreadSafe
 class ConnectionHolder implements ConnectionReleaseTrigger, Cancellable, Closeable {
 
-    private final Log log;
+    private final static String TAG = "HttpClient";
 
     private final HttpClientConnectionManager manager;
     private final HttpClientConnection managedConn;
@@ -58,11 +58,9 @@ class ConnectionHolder implements Connec
     private volatile boolean released;
 
     public ConnectionHolder(
-            final Log log,
             final HttpClientConnectionManager manager,
             final HttpClientConnection managedConn) {
         super();
-        this.log = log;
         this.manager = manager;
         this.managedConn = managedConn;
     }
@@ -102,10 +100,10 @@ class ConnectionHolder implements Connec
             } else {
                 try {
                     this.managedConn.close();
-                    log.debug("Connection discarded");
+                    Log.d(TAG, "Connection discarded");
                 } catch (final IOException ex) {
-                    if (this.log.isDebugEnabled()) {
-                        this.log.debug(ex.getMessage(), ex);
+                    if (Log.isLoggable(TAG, Log.DEBUG)) {
+                        Log.d(TAG, ex.getMessage(), ex);
                     }
                 } finally {
                     this.manager.releaseConnection(
@@ -123,10 +121,10 @@ class ConnectionHolder implements Connec
             this.released = true;
             try {
                 this.managedConn.shutdown();
-                log.debug("Connection discarded");
+                Log.d(TAG, "Connection discarded");
             } catch (final IOException ex) {
-                if (this.log.isDebugEnabled()) {
-                    this.log.debug(ex.getMessage(), ex);
+                if (Log.isLoggable(TAG, Log.DEBUG)) {
+                    Log.d(TAG, ex.getMessage(), ex);
                 }
             } finally {
                 this.manager.releaseConnection(
@@ -137,7 +135,7 @@ class ConnectionHolder implements Connec
 
     public boolean cancel() {
         final boolean alreadyReleased = this.released;
-        log.debug("Cancelling request execution");
+        Log.d(TAG, "Cancelling request execution");
         abortConnection();
         return !alreadyReleased;
     }

Modified: httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/execchain/MainClientExec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/execchain/MainClientExec.java?rev=1573718&r1=1573717&r2=1573718&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/execchain/MainClientExec.java (original)
+++ httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/execchain/MainClientExec.java Mon Mar  3 20:02:31 2014
@@ -32,8 +32,8 @@ import java.io.InterruptedIOException;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import android.util.Log;
+
 import org.apache.http.ConnectionReuseStrategy;
 import org.apache.http.HttpClientConnection;
 import org.apache.http.HttpEntity;
@@ -87,7 +87,7 @@ import org.apache.http.util.EntityUtilsH
 @Immutable
 public class MainClientExec implements ClientExecChain {
 
-    private final Log log = LogFactory.getLog(getClass());
+    private final static String TAG = "HttpClient";
 
     private final HttpRequestExecutor requestExecutor;
     private final HttpClientConnectionManager connManager;
@@ -187,15 +187,15 @@ public class MainClientExec implements C
         if (config.isStaleConnectionCheckEnabled()) {
             // validate connection
             if (managedConn.isOpen()) {
-                this.log.debug("Stale connection check");
+                Log.d(TAG, "Stale connection check");
                 if (managedConn.isStale()) {
-                    this.log.debug("Stale connection detected");
+                    Log.d(TAG, "Stale connection detected");
                     managedConn.close();
                 }
             }
         }
 
-        final ConnectionHolder connHolder = new ConnectionHolder(this.log, this.connManager, managedConn);
+        final ConnectionHolder connHolder = new ConnectionHolder(this.connManager, managedConn);
         try {
             if (execAware != null) {
                 execAware.setCancellable(connHolder);
@@ -214,12 +214,12 @@ public class MainClientExec implements C
                 }
 
                 if (!managedConn.isOpen()) {
-                    this.log.debug("Opening connection " + route);
+                    Log.d(TAG, "Opening connection " + route);
                     try {
                         establishRoute(proxyAuthState, managedConn, route, request, context);
                     } catch (final TunnelRefusedException ex) {
-                        if (this.log.isDebugEnabled()) {
-                            this.log.debug(ex.getMessage());
+                        if (Log.isLoggable(TAG, Log.DEBUG)) {
+                            Log.d(TAG, ex.getMessage());
                         }
                         response = ex.getResponse();
                         break;
@@ -234,19 +234,19 @@ public class MainClientExec implements C
                     throw new RequestAbortedException("Request aborted");
                 }
 
-                if (this.log.isDebugEnabled()) {
-                    this.log.debug("Executing request " + request.getRequestLine());
+                if (Log.isLoggable(TAG, Log.DEBUG)) {
+                    Log.d(TAG, "Executing request " + request.getRequestLine());
                 }
 
                 if (!request.containsHeader(AUTH.WWW_AUTH_RESP)) {
-                    if (this.log.isDebugEnabled()) {
-                        this.log.debug("Target auth state: " + targetAuthState.getState());
+                    if (Log.isLoggable(TAG, Log.DEBUG)) {
+                        Log.d(TAG, "Target auth state: " + targetAuthState.getState());
                     }
                     this.authenticator.generateAuthResponse(request, targetAuthState, context);
                 }
                 if (!request.containsHeader(AUTH.PROXY_AUTH_RESP) && !route.isTunnelled()) {
-                    if (this.log.isDebugEnabled()) {
-                        this.log.debug("Proxy auth state: " + proxyAuthState.getState());
+                    if (Log.isLoggable(TAG, Log.DEBUG)) {
+                        Log.d(TAG, "Proxy auth state: " + proxyAuthState.getState());
                     }
                     this.authenticator.generateAuthResponse(request, proxyAuthState, context);
                 }
@@ -257,14 +257,14 @@ public class MainClientExec implements C
                 if (reuseStrategy.keepAlive(response, context)) {
                     // Set the idle duration of this connection
                     final long duration = keepAliveStrategy.getKeepAliveDuration(response, context);
-                    if (this.log.isDebugEnabled()) {
+                    if (Log.isLoggable(TAG, Log.DEBUG)) {
                         final String s;
                         if (duration > 0) {
                             s = "for " + duration + " " + TimeUnit.MILLISECONDS;
                         } else {
                             s = "indefinitely";
                         }
-                        this.log.debug("Connection can be kept alive " + s);
+                        Log.d(TAG, "Connection can be kept alive " + s);
                     }
                     connHolder.setValidFor(duration, TimeUnit.MILLISECONDS);
                     connHolder.markReusable();
@@ -283,13 +283,13 @@ public class MainClientExec implements C
                         if (proxyAuthState.getState() == AuthProtocolState.SUCCESS
                                 && proxyAuthState.getAuthScheme() != null
                                 && proxyAuthState.getAuthScheme().isConnectionBased()) {
-                            this.log.debug("Resetting proxy auth state");
+                            Log.d(TAG, "Resetting proxy auth state");
                             proxyAuthState.reset();
                         }
                         if (targetAuthState.getState() == AuthProtocolState.SUCCESS
                                 && targetAuthState.getAuthScheme() != null
                                 && targetAuthState.getAuthScheme().isConnectionBased()) {
-                            this.log.debug("Resetting target auth state");
+                            Log.d(TAG, "Resetting target auth state");
                             targetAuthState.reset();
                         }
                     }
@@ -379,7 +379,7 @@ public class MainClientExec implements C
             case HttpRouteDirector.TUNNEL_TARGET: {
                 final boolean secure = createTunnelToTarget(
                         proxyAuthState, managedConn, route, request, context);
-                this.log.debug("Tunnel to target created.");
+                Log.d(TAG, "Tunnel to target created.");
                 tracker.tunnelTarget(secure);
             }   break;
 
@@ -390,7 +390,7 @@ public class MainClientExec implements C
                 // fact:  Source -> P1 -> Target       (2 hops)
                 final int hop = fact.getHopCount()-1; // the hop to establish
                 final boolean secure = createTunnelToProxy(route, hop, context);
-                this.log.debug("Tunnel to proxy created.");
+                Log.d(TAG, "Tunnel to proxy created.");
                 tracker.tunnelProxy(route.getHopTarget(hop), secure);
             }   break;
 
@@ -467,7 +467,7 @@ public class MainClientExec implements C
                             this.proxyAuthStrategy, proxyAuthState, context)) {
                         // Retry request
                         if (this.reuseStrategy.keepAlive(response, context)) {
-                            this.log.debug("Connection kept alive");
+                            Log.d(TAG, "Connection kept alive");
                             // Consume response content
                             final HttpEntity entity = response.getEntity();
                             EntityUtilsHC4.consume(entity);

Modified: httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/execchain/MinimalClientExec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/execchain/MinimalClientExec.java?rev=1573718&r1=1573717&r2=1573718&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/execchain/MinimalClientExec.java (original)
+++ httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/execchain/MinimalClientExec.java Mon Mar  3 20:02:31 2014
@@ -34,8 +34,8 @@ import java.net.URISyntaxException;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import android.util.Log;
+
 import org.apache.http.ConnectionReuseStrategy;
 import org.apache.http.HttpClientConnection;
 import org.apache.http.HttpEntity;
@@ -80,7 +80,7 @@ import org.apache.http.util.VersionInfoH
 @Immutable
 public class MinimalClientExec implements ClientExecChain {
 
-    private final Log log = LogFactory.getLog(getClass());
+    private final static String TAG = "HttpClient";
 
     private final HttpRequestExecutor requestExecutor;
     private final HttpClientConnectionManager connManager;
@@ -166,7 +166,7 @@ public class MinimalClientExec implement
             throw new RequestAbortedException("Request execution failed", cause);
         }
 
-        final ConnectionHolder releaseTrigger = new ConnectionHolder(log, connManager, managedConn);
+        final ConnectionHolder releaseTrigger = new ConnectionHolder(connManager, managedConn);
         try {
             if (execAware != null) {
                 if (execAware.isAborted()) {

Modified: httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/execchain/ProtocolExec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/execchain/ProtocolExec.java?rev=1573718&r1=1573717&r2=1573718&view=diff
==============================================================================
--- httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/execchain/ProtocolExec.java (original)
+++ httpcomponents/httpclient-android/branches/4.3.3-android/src/main/java/org/apache/http/impl/execchain/ProtocolExec.java Mon Mar  3 20:02:31 2014
@@ -31,8 +31,8 @@ import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import android.util.Log;
+
 import org.apache.http.HttpException;
 import org.apache.http.HttpHost;
 import org.apache.http.HttpRequest;
@@ -72,7 +72,7 @@ import org.apache.http.util.Args;
 @SuppressWarnings("deprecation")
 public class ProtocolExec implements ClientExecChain {
 
-    private final Log log = LogFactory.getLog(getClass());
+    private final static String TAG = "HttpClient";
 
     private final ClientExecChain requestExecutor;
     private final HttpProcessor httpProcessor;
@@ -132,8 +132,8 @@ public class ProtocolExec implements Cli
             try {
                 uri = URI.create(uriString);
             } catch (final IllegalArgumentException ex) {
-                if (this.log.isDebugEnabled()) {
-                    this.log.debug("Unable to parse '" + uriString + "' as a valid URI; " +
+                if (Log.isLoggable(TAG, Log.DEBUG)) {
+                    Log.d(TAG, "Unable to parse '" + uriString + "' as a valid URI; " +
                         "request URI and Host header may be inconsistent", ex);
                 }
             }
@@ -153,8 +153,8 @@ public class ProtocolExec implements Cli
                 virtualHost = new HttpHost(virtualHost.getHostName(), port,
                     virtualHost.getSchemeName());
             }
-            if (this.log.isDebugEnabled()) {
-                this.log.debug("Using virtual host" + virtualHost);
+            if (Log.isLoggable(TAG, Log.DEBUG)) {
+                Log.d(TAG, "Using virtual host" + virtualHost);
             }
         }