Skip to content

Use a common log prefix to make log provenance clearer and improve gr…#257

Open
kiftio wants to merge 5 commits into
mainfrom
log-prefix
Open

Use a common log prefix to make log provenance clearer and improve gr…#257
kiftio wants to merge 5 commits into
mainfrom
log-prefix

Conversation

@kiftio

@kiftio kiftio commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

What changes are you making?

  • Use a common prefix for Checkout Kit library logs (checkout_kit).
  • Use a common prefix for sample app logs (mobile_buy_integration, accelerated_checkouts_app, react_native_sample)

All log messages across Android, iOS/Swift, React Native, and Web platforms are now formatted as [<prefix>:<scope>], where the scope is normalized to snake_case. This replaces the previous inconsistent use of class names (e.g. [ShopifyCheckoutKit], [ShopifyAcceleratedCheckouts]) as log tags.

A shared toSnakeCase / toLogScope utility is introduced on each platform to handle well-known name mappings (e.g. ShopifyCheckoutKitcheckout_kit, CheckoutECPecp) and fall back to automatic snake_case conversion for everything else. On Android, all log calls now use the fixed tag checkout_kit rather than the caller-supplied tag. On the React Native module, a new logging.ts module centralises formatLogPrefix. The sample apps follow the same convention under their own prefixes.

How to test

  1. Run the existing test suites on each platform — updated assertions verify the new [prefix:scope] format in log output.
  2. Launch a sample app and confirm that log output in Logcat / Console / Metro uses the [checkout_kit:<scope>] format for SDK logs and the appropriate sample-app prefix for app-level logs.
  3. Trigger error paths (invalid color string, failed checkout, geolocation prompt, etc.) and confirm the log messages carry the correct prefix and scope.

Before you merge

Important

  • I've added tests to support my implementation
  • I have read and agree with the Contribution Guidelines
  • I have read and agree with the Code of Conduct
  • I've updated the relevant platform README (platforms/swift/README.md and/or platforms/android/README.md)

Releasing a new Swift version?
  • I have bumped the version in ShopifyCheckoutKit.podspec
  • I have bumped the version in platforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swift
  • I have updated platforms/swift/CHANGELOG.md
  • I have updated the SwiftPM/CocoaPods version snippets in platforms/swift/README.md (major version only)
Releasing a new Android version?
  • I have bumped the versionName in platforms/android/lib/build.gradle
  • I have updated platforms/android/CHANGELOG.md
  • I have updated the Gradle/Maven version snippets in platforms/android/README.md

Tip

See the Contributing documentation for the full release process per platform.

@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

Web — Coverage Report

Lines Statements Branches Functions
Coverage: 99%
98.81% (250/253) 87.85% (123/140) 100% (54/54)

@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

React Native — Coverage Report

Lines Statements Branches Functions
Coverage: 92%
91.78% (324/353) 87.55% (183/209) 100% (84/84)

@kiftio kiftio marked this pull request as ready for review June 5, 2026 08:02
@kiftio kiftio requested a review from a team as a code owner June 5, 2026 08:02
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.

1 participant