lbdremy/solr-node-client — pull request #70 by mrlannigan (2013-09-20 19:03:04+00:00)
Title: Added request debugging hook

Added a request debug hook to enable the ability to capture the exact URL and response times for a particular ran query. Debugging can simply be enabled with a boolean to output to `console.log` or it can be function that receives a single object as the first argument describing the results of a query request.

Adding this feature hook made it very easy to capture the resulting query's URL without having to "rebuild" the full URL by using a combination of `query.build()` and `query.options` to begin testing and/or debugging.

### Examples

Outputs request debug object with `console.log`
```js
solr.createClient({
host: 'localhost',
debug: true
});
```

Executes callback function passing `debugInfo` as first argument.
```js
solr.createClient({
host: 'localhost',
debug: function (debugInfo) {
console.log('Solr request to ' + debugInfo.requestedUrl + ' took ' + debugInfo.responseTime + 'ms');
}
});
```