Skip to content

Commit b6901e0

Browse files
authored
fix(android): Use Logger class instead of Log in CapacitorCookieManager (#6925)
1 parent b5b0398 commit b6901e0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

android/capacitor/src/main/java/com/getcapacitor/plugin/CapacitorCookieManager.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.getcapacitor.plugin;
22

3-
import android.util.Log;
43
import com.getcapacitor.Bridge;
4+
import com.getcapacitor.Logger;
55
import java.net.CookieManager;
66
import java.net.CookiePolicy;
77
import java.net.CookieStore;
@@ -64,7 +64,7 @@ public String getSanitizedDomain(String url) throws URISyntaxException {
6464
try {
6565
new URI(url);
6666
} catch (Exception error) {
67-
Log.e(TAG, "Failed to get sanitized URL.", error);
67+
Logger.error(TAG, "Failed to get sanitized URL.", error);
6868
throw error;
6969
}
7070
}
@@ -85,10 +85,10 @@ private String getDomainFromCookieString(String cookie) throws URISyntaxExceptio
8585
public String getCookieString(String url) {
8686
try {
8787
url = getSanitizedDomain(url);
88-
Log.i(TAG, "Getting cookies at: '" + url + "'");
88+
Logger.info(TAG, "Getting cookies at: '" + url + "'");
8989
return webkitCookieManager.getCookie(url);
9090
} catch (Exception error) {
91-
Log.e(TAG, "Failed to get cookies at the given URL.", error);
91+
Logger.error(TAG, "Failed to get cookies at the given URL.", error);
9292
}
9393

9494
return null;
@@ -145,11 +145,11 @@ public HttpCookie[] getCookies(String url) {
145145
public void setCookie(String url, String value) {
146146
try {
147147
url = getSanitizedDomain(url);
148-
Log.i(TAG, "Setting cookie '" + value + "' at: '" + url + "'");
148+
Logger.info(TAG, "Setting cookie '" + value + "' at: '" + url + "'");
149149
webkitCookieManager.setCookie(url, value);
150150
flush();
151151
} catch (Exception error) {
152-
Log.e(TAG, "Failed to set cookie.", error);
152+
Logger.error(TAG, "Failed to set cookie.", error);
153153
}
154154
}
155155

0 commit comments

Comments
 (0)