Skip to content

Commit

Permalink
Merge pull request #91 from superwall-me/develop
Browse files Browse the repository at this point in the history
1.0.0-alpha.43
  • Loading branch information
yusuftor authored Jan 26, 2024
2 parents 05988c5 + e7b40bd commit 0efd1f3
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 16 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

The changelog for `Superwall`. Also see the [releases](https://github.com/superwall-me/Superwall-Android/releases) on GitHub.

## 1.0.0-alpha.43

### Enhancements

- Adds `handleLog` to the `SuperwallDelegate`.

## 1.0.0-alpha.42

### Fixes
Expand Down
2 changes: 1 addition & 1 deletion superwall/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ plugins {
id("maven-publish")
}

version = "1.0.0-alpha.42"
version = "1.0.0-alpha.43"

android {
compileSdk = 33
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,23 @@ class SuperwallDelegateAdapter {
?: javaDelegate?.subscriptionStatusDidChange(newValue)
}

private fun handleLog(
fun handleLog(
level: String,
scope: String,
message: String?,
info: Map<String, Any>?,
error: Throwable?
) {
Logger.debug(
logLevel = LogLevel.valueOf(level),
scope = LogScope.valueOf(scope),
message = message ?: "No message",
kotlinDelegate?.handleLog(
level = level,
scope = scope,
message = message,
info = info,
error = error
) ?: javaDelegate?.handleLog(
level = level,
scope = scope,
message = message,
info = info,
error = error
)
Expand Down
19 changes: 9 additions & 10 deletions superwall/src/main/java/com/superwall/sdk/logger/Logger.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,15 @@ interface Loggable {
dumping["error"] = it
}

// TODO: Add logging to the delegate
// Launch a coroutine to handle the logging

// Superwall.instance.dependencyContainer.delegateAdapter.handleLog(
// level = logLevel.toString(),
// scope = scope.toString(),
// message = message,
// info = info,
// error = error
// )
if (Superwall.initialized) {
Superwall.instance.dependencyContainer.delegateAdapter.handleLog(
level = logLevel.toString(),
scope = scope.toString(),
message = message,
info = info,
error = error
)
}

if (!shouldPrint(logLevel, scope)) {
return
Expand Down

0 comments on commit 0efd1f3

Please sign in to comment.