Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task(SDK-3215) - Updates Logger implementation to static for PT module #464

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
}
}

Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
Expand All @@ -484,15 +483,15 @@ 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
if (!ico.isEmpty()) {
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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
Expand Down