This repository has been archived by the owner on Jun 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
101a078
commit 5b20f90
Showing
9 changed files
with
83 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System.Diagnostics; | ||
using Eventuous.Diagnostics; | ||
using Serilog; | ||
|
||
namespace Bookings.Payments.Infrastructure; | ||
|
||
public sealed class TestActivityListener : IDisposable{ | ||
readonly ActivityListener _listener; | ||
|
||
public TestActivityListener() { | ||
_listener = new ActivityListener { | ||
ShouldListenTo = _ => true, | ||
Sample = (ref ActivityCreationOptions<ActivityContext> _) | ||
=> ActivitySamplingResult.AllData, | ||
ActivityStarted = activity => Log.Information( | ||
"Started {Activity} with {Id}, parent {ParentId}", | ||
activity.DisplayName, | ||
activity.Id, | ||
activity.ParentId | ||
), | ||
ActivityStopped = activity | ||
=> Log.Information("Stopped {Activity}", activity.DisplayName) | ||
}; | ||
} | ||
|
||
public void Dispose() => _listener.Dispose(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System.Diagnostics; | ||
using Serilog; | ||
|
||
namespace Bookings.Infrastructure; | ||
|
||
public sealed class TestActivityListener : IDisposable { | ||
readonly ActivityListener _listener; | ||
|
||
public TestActivityListener() { | ||
_listener = new ActivityListener { | ||
ShouldListenTo = _ => true, | ||
Sample = (ref ActivityCreationOptions<ActivityContext> _) | ||
=> ActivitySamplingResult.AllData, | ||
ActivityStarted = activity => Log.Information( | ||
"Started {Activity} with {Id}, parent {ParentId}", | ||
activity.DisplayName, | ||
activity.Id, | ||
activity.ParentId | ||
), | ||
ActivityStopped = activity | ||
=> Log.Information("Stopped {Activity}", activity.DisplayName) | ||
}; | ||
ActivitySource.AddActivityListener(_listener); | ||
} | ||
|
||
public void Dispose() => _listener.Dispose(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters