Skip to content

[Web] Add log-level attribute for console verbosity#443

Merged
markmur merged 2 commits into
mainfrom
web-log-level-attribute
Jul 15, 2026
Merged

[Web] Add log-level attribute for console verbosity#443
markmur merged 2 commits into
mainfrom
web-log-level-attribute

Conversation

@markmur

@markmur markmur commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

What

Replaces 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, none silences everything; selecting a level emits that level and every more-severe level.
  • Defaults to error. This intentionally diverges from the other platforms (which default to warn): web logs go to the browser console, which is inherently more public than a native device log, so we default to the quietest level that still surfaces failures during integration.
  • Console output is routed through a small Logger utility gated by the current level, replacing the ad-hoc debug-gated warnings.

Threshold

log-level console.debug console.warn console.error
debug
warn
error (default)
none

Usage

<!-- attribute -->
<shopify-checkout log-level="debug" src="..."></shopify-checkout>
// property
const checkout = document.querySelector('shopify-checkout');
checkout.logLevel = 'error'; // errors only
checkout.logLevel = 'none';  // silence everything

Migration

- <shopify-checkout debug src="..."></shopify-checkout>
+ <shopify-checkout log-level="debug" src="..."></shopify-checkout>

markmur commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

@markmur
markmur marked this pull request as ready for review July 13, 2026 18:13
@markmur
markmur requested a review from a team as a code owner July 13, 2026 18:13
@markmur
markmur requested a review from westeezy July 13, 2026 18:13
@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown

Web — Coverage Report

Lines Statements Branches Functions
Coverage: 99%
98.8% (248/251) 85.49% (112/131) 98.57% (69/70)

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown

Package Size

Platform Artifact Base Head Delta
Web npm tarball 63.8 KiB 65.5 KiB +1.7 KiB
Web file breakdown
File Base Head Delta
dist/index.js.map 182.0 KiB 184.1 KiB +2.1 KiB
dist/index.d.ts 41.2 KiB 41.9 KiB +665 B
dist/custom-elements.json 36.0 KiB 40.1 KiB +4.2 KiB
dist/index.js 29.2 KiB 29.6 KiB +387 B
README.md 17.2 KiB 17.8 KiB +634 B
package.json 2.8 KiB 2.8 KiB 0 B
LICENSE 1.1 KiB 1.1 KiB 0 B

Measured from the PR base SHA and PR head SHA. The file breakdown shows uncompressed sizes within each package artifact, so individual files do not sum to the compressed artifact total. This comment reports package artifact sizes only; it is not a final app binary-size report.

@markmur markmur self-assigned this Jul 13, 2026
@markmur
markmur force-pushed the android-none-log-level branch from 1054096 to b010e3d Compare July 14, 2026 08:00
@markmur
markmur force-pushed the web-log-level-attribute branch 2 times, most recently from acbc2a3 to e2a9f02 Compare July 14, 2026 08:22
@markmur
markmur force-pushed the android-none-log-level branch from b010e3d to c22b498 Compare July 14, 2026 08:22
@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 android-none-log-level branch from c22b498 to d2ad5fe Compare July 14, 2026 08:48
Comment thread platforms/web/src/checkout.types.ts Outdated
Comment thread platforms/web/src/checkout.ts Outdated
Comment thread platforms/web/src/checkout.ts Outdated
Comment thread platforms/web/src/checkout.ts Outdated
@markmur
markmur force-pushed the android-none-log-level branch from d2ad5fe to efee365 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 android-none-log-level branch from efee365 to 378ab6c 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 changed the base branch from android-none-log-level to graphite-base/443 July 14, 2026 11:34
@markmur
markmur force-pushed the web-log-level-attribute branch from 241b93c to df991a6 Compare July 14, 2026 11:43
@markmur
markmur force-pushed the graphite-base/443 branch from 378ab6c to 497a8db Compare July 14, 2026 11:43
@graphite-app
graphite-app Bot changed the base branch from graphite-base/443 to main July 14, 2026 11:44
@markmur
markmur force-pushed the web-log-level-attribute branch from df991a6 to 95ddc32 Compare July 14, 2026 11:44
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.
@markmur
markmur force-pushed the web-log-level-attribute branch from 95ddc32 to 4d6ae40 Compare July 14, 2026 15:54
Comment thread platforms/web/README.md
@markmur
markmur merged commit 7c8ba07 into main Jul 15, 2026
26 checks passed
@markmur
markmur deleted the web-log-level-attribute branch 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.

4 participants