Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d0dbbb1

Browse files
Extend LogEventBenchmark with ILogger.Log that includes EventId.
1 parent 7fc50b0 commit d0dbbb1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎test/Serilog.Extensions.Logging.Benchmarks/LogEventBenchmark.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ private class Person
3434

3535
readonly IMelLogger _melLogger;
3636
readonly Person _bob, _alice;
37+
readonly EventId _eventId = new EventId(1, "Test");
3738

3839
public LogEventBenchmark()
3940
{
@@ -61,5 +62,16 @@ public void LogInformationScoped()
6162
using (var scope = _melLogger.BeginScope("Hi {@User} from {$Me}", _bob, _alice))
6263
_melLogger.LogInformation("Hi");
6364
}
65+
66+
[Benchmark]
67+
public void LogInformation_WithEventId()
68+
{
69+
this._melLogger.Log(
70+
LogLevel.Information,
71+
_eventId,
72+
"Hi {@User} from {$Me}",
73+
_bob,
74+
_alice);
75+
}
6476
}
6577
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /