Skip to content

Commit

Permalink
Replace console logging with spanevent in cartservice - .NET (open-te…
Browse files Browse the repository at this point in the history
  • Loading branch information
cijothomas committed Jun 5, 2022
1 parent a8978f6 commit 6f32d9a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/cartservice/src/cartstore/LocalCartStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@

using System;
using System.Collections.Concurrent;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;

namespace cartservice.cartstore
{
Expand Down Expand Up @@ -62,9 +63,11 @@ public Task AddItemAsync(string userId, string productId, int quantity)

public Task EmptyCartAsync(string userId)
{
Console.WriteLine($"EmptyCartAsync called with userId={userId}");
var eventTags = new ActivityTagsCollection();
eventTags.Add("userId", userId);
Activity.Current?.AddEvent(new ActivityEvent("EmptyCartAsync called.", default, eventTags));

userCartItems[userId] = new Hipstershop.Cart();

return Task.CompletedTask;
}

Expand Down

0 comments on commit 6f32d9a

Please sign in to comment.