From 0f5c3dd68fea153059911d5b00f0dfcdf2629974 Mon Sep 17 00:00:00 2001 From: anush Date: Wed, 30 Aug 2023 14:35:54 +0530 Subject: [PATCH] task(SDK-3215) - Updates Logger implementation to static for PT module --- .../android/pushtemplates/TemplateRenderer.kt | 15 +++++++-------- .../clevertap/android/pushtemplates/Utils.java | 3 +-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/TemplateRenderer.kt b/clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/TemplateRenderer.kt index f6ab5e171..f97cc68ee 100644 --- a/clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/TemplateRenderer.kt +++ b/clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/TemplateRenderer.kt @@ -21,7 +21,6 @@ import com.clevertap.android.pushtemplates.validators.ValidatorFactory import com.clevertap.android.sdk.CleverTapAPI import com.clevertap.android.sdk.CleverTapInstanceConfig import com.clevertap.android.sdk.Constants -import com.clevertap.android.sdk.Logger import com.clevertap.android.sdk.ManifestInfo import com.clevertap.android.sdk.interfaces.AudibleNotification import com.clevertap.android.sdk.pushnotification.CTNotificationIntentService @@ -252,7 +251,7 @@ class TemplateRenderer : INotificationRenderer, AudibleNotification { try { ptJsonObj = JSONObject(ptJsonStr) } catch (e: Exception) { - Logger.v("Unable to convert JSON to String") + PTLog.verbose("Unable to convert JSON to String") } } @@ -349,7 +348,7 @@ class TemplateRenderer : INotificationRenderer, AudibleNotification { } } } catch (t: Throwable) { - config.logger.debug(config.accountId, "Could not process sound parameter", t) + PTLog.debug(config.accountId + " Could not process sound parameter", t) } return nb } @@ -463,14 +462,14 @@ class TemplateRenderer : INotificationRenderer, AudibleNotification { try { clazz = Class.forName("com.clevertap.android.sdk.pushnotification.CTNotificationIntentService") } catch (ex: ClassNotFoundException) { - Logger.d("No Intent Service found") + PTLog.debug("No Intent Service found") } } } else { try { clazz = Class.forName("com.clevertap.android.sdk.pushnotification.CTNotificationIntentService") } catch (ex: ClassNotFoundException) { - Logger.d("No Intent Service found") + PTLog.debug("No Intent Service found") } } val isCTIntentServiceAvailable = com.clevertap.android.sdk.Utils.isServiceAvailable(context, clazz) @@ -484,7 +483,7 @@ class TemplateRenderer : INotificationRenderer, AudibleNotification { val id = action.optString("id") val autoCancel = action.optBoolean("ac", true) if (label.isEmpty() || id.isEmpty()) { - Logger.d("not adding push notification action: action label or id missing") + PTLog.debug("not adding push notification action: action label or id missing") continue } var icon = 0 @@ -492,7 +491,7 @@ class TemplateRenderer : INotificationRenderer, AudibleNotification { try { icon = context.resources.getIdentifier(ico, "drawable", context.packageName) } catch (t: Throwable) { - Logger.d("unable to add notification action icon: " + t.localizedMessage) + PTLog.debug("unable to add notification action icon: " + t.localizedMessage) } } var sendToCTIntentService = (VERSION.SDK_INT < VERSION_CODES.S && autoCancel @@ -570,7 +569,7 @@ class TemplateRenderer : INotificationRenderer, AudibleNotification { } nb.addAction(icon, label, actionIntent) } catch (t: Throwable) { - Logger.d("error adding notification action : " + t.localizedMessage) + PTLog.debug("error adding notification action : " + t.localizedMessage) } } } // Uncommon - END diff --git a/clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/Utils.java b/clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/Utils.java index 1ddb917b0..1b2d0db2d 100644 --- a/clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/Utils.java +++ b/clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/Utils.java @@ -34,7 +34,6 @@ import com.clevertap.android.sdk.CleverTapAPI; import com.clevertap.android.sdk.CleverTapInstanceConfig; import com.clevertap.android.sdk.Constants; -import com.clevertap.android.sdk.Logger; import com.clevertap.android.sdk.network.NetworkManager; import com.clevertap.android.sdk.task.CTExecutorFactory; import com.clevertap.android.sdk.task.Task; @@ -107,7 +106,7 @@ private static Bitmap getBitmapFromURL(String srcUrl, @Nullable Context context) if (context != null) { boolean isNetworkOnline = NetworkManager.isNetworkOnline(context); if (!isNetworkOnline) { - Logger.v("Network connectivity unavailable. Not downloading bitmap. URL was: " + srcUrl); + PTLog.verbose("Network connectivity unavailable. Not downloading bitmap. URL was: " + srcUrl); return null; } }