Skip to content

Add debug logging #203

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

Merged
merged 5 commits into from
May 1, 2025
Merged

Add debug logging #203

merged 5 commits into from
May 1, 2025

Conversation

kiftio
Copy link
Contributor

@kiftio kiftio commented Apr 29, 2025

What changes are you making?

Allowing emission of debug logs via

ShopifyCheckoutSheetKit.configure {
        it.logLevel = LogLevel.DEBUG
}

I've opted to enabling debug logs only via explicit configuration to prevent altering logging for any existing clients who don't require it (via defaulting to LogLevel.WARN).


Video of some logs being emitted:

debug-logs.mp4

How to test

  • Configure as above
  • Run the app
  • Open checkout
  • Check logcat for debug output.

Then repeat, with LogLevel.WARN, LogLevel.ERROR, and omitting it.logLevel to check the default, and ensure the logs no longer appear.

Before you merge

Important


Checklist for releasing a new version

Tip

See the Contributing documentation for instructions on how to publish a new version of the library.

@kiftio kiftio force-pushed the dk/debug-logging branch from d8ae6b7 to 0480e67 Compare April 30, 2025 10:51
@kiftio kiftio marked this pull request as ready for review April 30, 2025 11:03
@kiftio kiftio requested a review from a team as a code owner April 30, 2025 11:03
@markmur
Copy link
Contributor

markmur commented Apr 30, 2025

@kiftio want to align this with the swift implementation?

https://github.com/Shopify/checkout-sheet-kit-swift/blob/3ef22767ba68f279b314fffc93ee96930aaa0d43/Sources/ShopifyCheckoutSheetKit/Configuration.swift#L60-L62

/// Levels: all, debug, error, none
/// Default: .error - which will emit "error" and "fault" logs
public var logLevel: LogLevel = .error

@kiftio
Copy link
Contributor Author

kiftio commented Apr 30, 2025

@kiftio want to align this with the swift implementation?

https://github.com/Shopify/checkout-sheet-kit-swift/blob/3ef22767ba68f279b314fffc93ee96930aaa0d43/Sources/ShopifyCheckoutSheetKit/Configuration.swift#L60-L62

/// Levels: all, debug, error, none
/// Default: .error - which will emit "error" and "fault" logs
public var logLevel: LogLevel = .error

I've updated it to something similar

@kiftio kiftio force-pushed the dk/debug-logging branch from f5869e0 to 9832d1d Compare April 30, 2025 18:13
Copy link
Contributor

@markmur markmur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@kiftio kiftio merged commit 3eeed93 into main May 1, 2025
4 checks passed
@kiftio kiftio deleted the dk/debug-logging branch May 1, 2025 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants