Skip to content

Commit 0514418

Browse files
committed
Add functions for getting the logging.
Change-Id: Ia12708f66e5ea7efb7ed889d0e924653f8d2fa44
1 parent a25f5b7 commit 0514418

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

AndroidAsync/AndroidAsync.iml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
</configuration>
1515
</facet>
1616
</component>
17-
<component name="NewModuleRootManager" inherit-compiler-output="false">
18-
<output url="file://$MODULE_DIR$/build/classes/debug" />
17+
<component name="NewModuleRootManager" inherit-compiler-output="true">
1918
<exclude-output />
2019
<content url="file://$MODULE_DIR$">
2120
<sourceFolder url="file://$MODULE_DIR$/build/source/r/debug" isTestSource="false" />

AndroidAsync/src/com/koushikdutta/async/http/AsyncHttpRequest.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,12 @@ public AsyncHttpRequest(URI uri, String method) {
9494
}
9595

9696
public static void setDefaultHeaders(RawHeaders ret, URI uri) {
97-
String host = uri.getHost();
98-
if (uri.getPort() != -1)
99-
host = host + ":" + uri.getPort();
100-
ret.set("Host", host);
97+
if (uri != null) {
98+
String host = uri.getHost();
99+
if (uri.getPort() != -1)
100+
host = host + ":" + uri.getPort();
101+
ret.set("Host", host);
102+
}
101103
ret.set("User-Agent", getDefaultUserAgent());
102104
ret.set("Accept-Encoding", "gzip, deflate");
103105
ret.set("Connection", "keep-alive");
@@ -347,6 +349,12 @@ public void setLogging(String tag, int level) {
347349
// request level logging
348350
String LOGTAG;
349351
int logLevel;
352+
public int getLogLevel() {
353+
return logLevel;
354+
}
355+
public String getLogTag() {
356+
return LOGTAG;
357+
}
350358
long executionTime;
351359
private String getLogMessage(String message) {
352360
long elapsed;

0 commit comments

Comments
 (0)