Skip to content

Commit

Permalink
Merge pull request square#484 from koalahamlet/master
Browse files Browse the repository at this point in the history
Add 'Logging' section to website
  • Loading branch information
JakeWharton committed May 16, 2014
2 parents c7b7701 + 17bc621 commit cb22c39
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions website/index.html
Original file line number Diff line number Diff line change
@@ -215,6 +215,16 @@ <h4>Custom Error Handling</h4>
.build();</pre>
<p>Note that if the return exception is checked, it must be declared on the interface method. It is recommended that you pass the supplied <code>RetrofitError</code> as the cause to any new exceptions you throw.</p>

<h4>Logging</h4>
<p>If you need to take a closer look at the requests and responses you can easily add logging levels to the <code>RestAdapter</code> with the <code>LogLevel</code> property. The possible logging levels are <code>BASIC</code>, <code>FULL</code>, <code>HEADERS</code>, and <code>NONE</code>.</p>
<p>The following code shows the addition of a full log level which will log the headers, body, and metadata for both requests and responses.</p>
<pre class="prettyprint">
RestAdapter restAdapter = new RestAdapter.Builder()
.setLogLevel(RestAdapter.LogLevel.FULL)
.setEndpoint("https://api.github.com")
.build();</pre>
<p>This logging can be added or changed at any point in the <code>RestAdapter</code>'s lifecycle by calling the same <code>.setLogLevel()</code> method and supplying a different <code>LogLevel</code> value.</p>

<h3 id="download">Download</h3>
<p><a href="http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.squareup.retrofit&a=retrofit&v=LATEST" class="dl version-href">&darr; <span class="version-tag">Latest</span> JAR</a></p>
<p>The source code to the Retrofit, its samples, and this website is <a href="http://github.com/square/retrofit">available on GitHub</a>.</p>

0 comments on commit cb22c39

Please sign in to comment.