Skip to content
New issue

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

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

Already on GitHub? # to your account

Improve how debug logging is enabled and how exceptions are logged #287

Merged
merged 1 commit into from
Sep 7, 2023

Conversation

jayohms
Copy link
Collaborator

@jayohms jayohms commented Sep 7, 2023

Previously, you needed a TurboSession instance to enable/disable debug logging. However, this was deceiving, since that debug setting was global across all sessions. The change in this PR reflects that debug logging is global across the app and can be set anywhere (ideally once).

Before:

class MainSessionNavHostFragment : TurboSessionNavHostFragment() {

    // ...

    override open fun onSessionCreated() {
        super.onSessionCreated()

        if (BuildConfig.DEBUG) {
          session.setDebugLoggingEnabled(true)
        }
    }

Now:

if (BuildConfig.DEBUG) {
    Turbo.config.debugLoggingEnabled = true
}

Additionally, logged errors now include the exception stacktrace.

@jayohms jayohms merged commit f40d830 into main Sep 7, 2023
@jayohms jayohms deleted the log-cleanup branch September 7, 2023 13:24
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant