Skip to content

[React Native] Canonicalize LogLevel to debug/warn/error/none#444

Draft
markmur wants to merge 2 commits into
mainfrom
rn-canonical-log-levels
Draft

[React Native] Canonicalize LogLevel to debug/warn/error/none#444
markmur wants to merge 2 commits into
mainfrom
rn-canonical-log-levels

Conversation

@markmur

@markmur markmur commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

What

Brings React Native in line with the other platforms' canonical, ordered LogLevel set: debug, warn, error, none.

  • Expands the JS LogLevel enum from {debug, error} to the full four-value set.
  • Forwards all four values across the iOS and Android bridges.
  • Drops the iOS .all reference (removed from the Swift SDK) and makes both bridge log-level mappings exhaustive.
  • Default log level is now warn (was error), aligning RN with Swift, Android, and Web. Unrecognised values from the native bridge coerce to warn.

Threshold

LogLevel debug warn error
debug
warn (default)
error
none

Usage

import {ShopifyCheckout, LogLevel} from '@shopify/checkout-kit-react-native';

const checkout = new ShopifyCheckout(url, {
  logLevel: LogLevel.debug, // debug + warnings + errors
});

checkout.setConfig({logLevel: LogLevel.none}); // silence everything

Validating locally

This PR depends on the unreleased native SDK changes in the stack (Swift #441, Android #442). The React Native --local / Maven Local workflow must publish those native SDKs first before the iOS/Android bridges resolve:

# Android: publishes the local Android SDK + Kotlin protocol to Maven Local, then runs RN tests
dev rn test android

# iOS sample against local platforms/swift sources
dev rn ios --local

Note: RN Android --local currently surfaces a pre-existing Configuration.colorScheme API gap between the RN bridge and the unreleased in-repo Android SDK (which uses appearance/sheet). That drift is unrelated to this change and is not addressed here. The JS suite (including the new coerceConfigurationResult log-level coverage) is fully green.

markmur commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

@markmur
markmur force-pushed the rn-canonical-log-levels branch from a879efd to bfc0b17 Compare July 14, 2026 08:00
@markmur
markmur force-pushed the web-log-level-attribute branch from d1c8fdb to acbc2a3 Compare July 14, 2026 08:00
@markmur
markmur force-pushed the rn-canonical-log-levels branch from bfc0b17 to c84de31 Compare July 14, 2026 08:22
@markmur
markmur force-pushed the web-log-level-attribute branch from acbc2a3 to e2a9f02 Compare July 14, 2026 08:22
@markmur
markmur force-pushed the rn-canonical-log-levels branch from c84de31 to d37c2b3 Compare July 14, 2026 08:48
@markmur
markmur force-pushed the web-log-level-attribute branch from e2a9f02 to dd25de8 Compare July 14, 2026 08:48
@markmur
markmur force-pushed the rn-canonical-log-levels branch from d37c2b3 to a6d44e2 Compare July 14, 2026 08:59
@markmur
markmur force-pushed the web-log-level-attribute branch from dd25de8 to 80b109a Compare July 14, 2026 08:59
@markmur
markmur force-pushed the rn-canonical-log-levels branch from a6d44e2 to f371fef Compare July 14, 2026 10:03
@markmur
markmur force-pushed the web-log-level-attribute branch 2 times, most recently from 3100346 to 241b93c Compare July 14, 2026 10:30
@markmur
markmur force-pushed the rn-canonical-log-levels branch from f371fef to 5ec1d55 Compare July 14, 2026 10:30
@markmur
markmur force-pushed the web-log-level-attribute branch 2 times, most recently from df991a6 to 95ddc32 Compare July 14, 2026 11:44
@markmur
markmur force-pushed the rn-canonical-log-levels branch from 5ec1d55 to 355f5a2 Compare July 14, 2026 11:44
markmur added 2 commits July 14, 2026 16:54
Replace the boolean `debug` attribute/property with a `log-level`
attribute and `logLevel` property carrying an ordered LogLevel enum
(debug, warn, error, none). Levels form a threshold: debug is the most
verbose and none silences everything; selecting a level emits that level
and every more-severe level. Defaults to warn.

Console output is routed through a small Logger utility gated by the
current level, replacing the ad-hoc debug-gated warnings.
Expand the JS LogLevel enum to the full ordered set (debug, warn, error, none) and forward all four values across the iOS and Android bridges. Drop the iOS .all reference (removed from the Swift SDK) and make both bridge log-level mappings exhaustive.

Default log level is now warn (was error), aligning React Native with Swift, Android, and Web.
@markmur
markmur force-pushed the rn-canonical-log-levels branch from 355f5a2 to c842266 Compare July 14, 2026 15:54
@markmur
markmur force-pushed the web-log-level-attribute branch from 95ddc32 to 4d6ae40 Compare July 14, 2026 15:54
Base automatically changed from web-log-level-attribute to main July 15, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:50662 Rebase Checkout Kit on UCP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant