1
1
package com .getcapacitor .plugin ;
2
2
3
- import android .util .Log ;
4
3
import com .getcapacitor .Bridge ;
4
+ import com .getcapacitor .Logger ;
5
5
import java .net .CookieManager ;
6
6
import java .net .CookiePolicy ;
7
7
import java .net .CookieStore ;
@@ -64,7 +64,7 @@ public String getSanitizedDomain(String url) throws URISyntaxException {
64
64
try {
65
65
new URI (url );
66
66
} catch (Exception error ) {
67
- Log . e (TAG , "Failed to get sanitized URL." , error );
67
+ Logger . error (TAG , "Failed to get sanitized URL." , error );
68
68
throw error ;
69
69
}
70
70
}
@@ -85,10 +85,10 @@ private String getDomainFromCookieString(String cookie) throws URISyntaxExceptio
85
85
public String getCookieString (String url ) {
86
86
try {
87
87
url = getSanitizedDomain (url );
88
- Log . i (TAG , "Getting cookies at: '" + url + "'" );
88
+ Logger . info (TAG , "Getting cookies at: '" + url + "'" );
89
89
return webkitCookieManager .getCookie (url );
90
90
} 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 );
92
92
}
93
93
94
94
return null ;
@@ -145,11 +145,11 @@ public HttpCookie[] getCookies(String url) {
145
145
public void setCookie (String url , String value ) {
146
146
try {
147
147
url = getSanitizedDomain (url );
148
- Log . i (TAG , "Setting cookie '" + value + "' at: '" + url + "'" );
148
+ Logger . info (TAG , "Setting cookie '" + value + "' at: '" + url + "'" );
149
149
webkitCookieManager .setCookie (url , value );
150
150
flush ();
151
151
} catch (Exception error ) {
152
- Log . e (TAG , "Failed to set cookie." , error );
152
+ Logger . error (TAG , "Failed to set cookie." , error );
153
153
}
154
154
}
155
155
0 commit comments