src/main/java/org/lightcouch/CouchDbClient.java
private void registerInterceptors(HttpClientBuilder clientBuilder) {
		clientBuilder.addInterceptorFirst(new HttpRequestInterceptor() {
			public void process(final HttpRequest request,
					final HttpContext context) throws IOException {
				if (log.isInfoEnabled()) {
					RequestLine req = request.getRequestLine();
					log.info("> " + req.getMethod() + " " + URLDecoder.decode(req.getUri(), "UTF-8"));
				}
			}
		});
		clientBuilder.addInterceptorFirst(new HttpResponseInterceptor() {
			public void process(final HttpResponse response,
					final HttpContext context) throws IOException {
				if (log.isInfoEnabled()) {
					log.info("< Status: " + response.getStatusLine().getStatusCode());
				}
				validate(response);
			}
		});
	}
private void registerInterceptors(HttpClientBuilder clientBuilder) {
		clientBuilder.addInterceptorFirst(new HttpRequestInterceptor() {
			public void process(final HttpRequest request,
					final HttpContext context) throws IOException {
				if (log.isInfoEnabled()) {
					RequestLine req = request.getRequestLine();
					log.info("> " + req.getMethod() + " " + URLDecoder.decode(req.getUri(), "UTF-8"));
				}
			}
		});
		clientBuilder.addInterceptorFirst(new HttpResponseInterceptor() {
			public void process(final HttpResponse response,
					final HttpContext context) throws IOException {
				if (log.isInfoEnabled()) {
					log.info("< Status: " + response.getStatusLine().getStatusCode());
				}
				validate(response);
			}
		});
	}
private void registerInterceptors ( HttpClientBuilder clientBuilder ) { clientBuilder . addInterceptorFirst ( new HttpRequestInterceptor ( ) { public void process ( final HttpRequest request , final HttpContext context ) throws IOException { if ( log . isInfoEnabled ( ) ) { RequestLine req = request . getRequestLine ( ) ; log . info ( "> " + req . getMethod ( ) + " " + URLDecoder . decode ( req . getUri ( ) , "UTF-8" ) ) ; } } } ) ; clientBuilder . addInterceptorFirst ( new HttpResponseInterceptor ( ) { public void process ( final HttpResponse response , final HttpContext context ) throws IOException { if ( log . isInfoEnabled ( ) ) { log . info ( "< Status: " + response . getStatusLine ( ) . getStatusCode ( ) ) ; } validate ( response ) ; } } ) ; }
Adds request/response interceptors for logging and validation.
@param clientBuilder
Adds request / response interceptors for logging and validation .