From b5281398a6548081367f82fd1ebda1a43faf466d Mon Sep 17 00:00:00 2001 From: jcesarmobile Date: Thu, 21 Sep 2023 16:23:18 +0200 Subject: [PATCH] fix(android): Use Logger class instead of Log in CapacitorCookieManager (#6923) --- .../getcapacitor/plugin/CapacitorCookieManager.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/android/capacitor/src/main/java/com/getcapacitor/plugin/CapacitorCookieManager.java b/android/capacitor/src/main/java/com/getcapacitor/plugin/CapacitorCookieManager.java index bcf274e751..1baf16695b 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/plugin/CapacitorCookieManager.java +++ b/android/capacitor/src/main/java/com/getcapacitor/plugin/CapacitorCookieManager.java @@ -1,7 +1,7 @@ package com.getcapacitor.plugin; -import android.util.Log; import com.getcapacitor.Bridge; +import com.getcapacitor.Logger; import java.net.CookieManager; import java.net.CookiePolicy; import java.net.CookieStore; @@ -64,7 +64,7 @@ public String getSanitizedDomain(String url) throws URISyntaxException { try { new URI(url); } catch (Exception error) { - Log.e(TAG, "Failed to get sanitized URL.", error); + Logger.error(TAG, "Failed to get sanitized URL.", error); throw error; } } @@ -85,10 +85,10 @@ private String getDomainFromCookieString(String cookie) throws URISyntaxExceptio public String getCookieString(String url) { try { url = getSanitizedDomain(url); - Log.i(TAG, "Getting cookies at: '" + url + "'"); + Logger.info(TAG, "Getting cookies at: '" + url + "'"); return webkitCookieManager.getCookie(url); } catch (Exception error) { - Log.e(TAG, "Failed to get cookies at the given URL.", error); + Logger.error(TAG, "Failed to get cookies at the given URL.", error); } return null; @@ -145,11 +145,11 @@ public HttpCookie[] getCookies(String url) { public void setCookie(String url, String value) { try { url = getSanitizedDomain(url); - Log.i(TAG, "Setting cookie '" + value + "' at: '" + url + "'"); + Logger.info(TAG, "Setting cookie '" + value + "' at: '" + url + "'"); webkitCookieManager.setCookie(url, value); flush(); } catch (Exception error) { - Log.e(TAG, "Failed to set cookie.", error); + Logger.error(TAG, "Failed to set cookie.", error); } }