Skip to content

feat: Add demo logs#113

Merged
nw-sentry merged 4 commits intomasterfrom
antonis/add-logs
Mar 19, 2026
Merged

feat: Add demo logs#113
nw-sentry merged 4 commits intomasterfrom
antonis/add-logs

Conversation

@antonis
Copy link
Collaborator

@antonis antonis commented Dec 17, 2025

Fixes #109

This PR adds logging throughout the application using Sentry's new logs feature.

Types of Logs Added

1. Application Lifecycle Logs

  • App initialization with customer type, email, and version
  • Navigation container ready events

2. Screen View Logs

  • Home screen viewed
  • Product detail viewed (with product ID, title, price)
  • Cart screen viewed (with item count, total items, total value)

3. User Action Logs

  • Product Interactions:

    • Product card pressed (with product details)
    • Products loaded (with product count)
    • Product detail viewed
  • Cart Operations:

    • Items added to cart (from product cards and detail screens)
    • Items removed from cart
    • Cart calculations ("Calculated itemsInCart: X")
    • Quantity updates ("Adding quantity: X")
    • Cart total calculations
  • Checkout Flow:

    • Checkout initiated
    • Checkout span with trace/span IDs and attributes
    • Checkout called with cart (detailed cart contents)
    • Checkout request sent
    • Checkout completed successfully
    • Checkout failures with error details

4. Navigation Logs

  • Navigation to checkout
  • Navigation container ready

5. Error & Debug Logs

  • Product loading errors (with endpoint and error details)
  • Checkout request failures (with error messages)
  • Checkout failures (with status codes and error messages)
  • API call debug logs (with endpoints and request details)

6. User Feedback Logs

  • User feedback modal opened
  • User feedback submitted (with event ID and message length)

@antonis antonis requested review from alwx and dachakra and removed request for cstavitsky and thinkocapo December 17, 2025 13:35
@antonis antonis marked this pull request as draft December 17, 2025 13:36
@antonis antonis linked an issue Dec 17, 2025 that may be closed by this pull request
@antonis antonis marked this pull request as ready for review December 17, 2025 14:36
Copy link

@alwx alwx left a comment

Choose a reason for hiding this comment

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

Looks good!

@antonis antonis requested review from landenai and removed request for dachakra January 14, 2026 15:03
@antonis antonis requested a review from nw-sentry March 17, 2026 11:43
Comment on lines +64 to +67
const spanContext = span?.spanContext?.() || {};
const transaction = Sentry.getCurrentScope().getTransaction();
Sentry.logger.info('Checkout span', {
_traceId: transaction?.traceId || spanContext.traceId,
Copy link
Contributor

Choose a reason for hiding this comment

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

getTransaction has been deprecated in 7.X https://docs.sentry.io/platforms/javascript/migration/v7-to-v8/v7-deprecations/#deprecate-scopegettransaction-and-getactivetransaction

Suggestion:

const activeSpan = span ?? Sentry.getActiveSpan();
const spanContext = activeSpan?.spanContext?.() ?? {};

Sentry.logger.info('Checkout span', {
  _traceId: spanCtx.traceId,

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you for the feedback @nw-sentry 🙇
Updated with 4b90e4f

@antonis antonis changed the base branch from antonis/bump-7.8.0 to master March 19, 2026 16:00
antonis and others added 2 commits March 19, 2026 17:02
…d getTransaction

- CartScreen: revert useEffect dependency array back to [] to prevent
  fetch on every cart change (sentry[bot] feedback)
- CheckoutScreen: replace deprecated getTransaction() with
  Sentry.getActiveSpan() (nw-sentry feedback)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link

@landenai landenai left a comment

Choose a reason for hiding this comment

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

Looks good

@nw-sentry nw-sentry merged commit 32d7400 into master Mar 19, 2026
9 checks passed
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.

Add More Logs

4 participants