Skip to content

Commit b33c2d5

Browse files
committed
Internalize and seal enricher classes
1 parent 5b2ce01 commit b33c2d5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Serilog.Enrichers.Thread/Enrichers/ThreadIdEnricher.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ namespace Serilog.Enrichers
2121
/// <summary>
2222
/// Enriches log events with a ThreadId property containing the <see cref="Environment.CurrentManagedThreadId"/>.
2323
/// </summary>
24-
public class ThreadIdEnricher : ILogEventEnricher
24+
sealed class ThreadIdEnricher : ILogEventEnricher
2525
{
2626
/// <summary>
2727
/// The property name added to enriched log events.
2828
/// </summary>
29-
public const string ThreadIdPropertyName = "ThreadId";
29+
const string ThreadIdPropertyName = "ThreadId";
3030

3131
/// <summary>
3232
/// The cached last created "ThreadId" property with some thread id. It is likely to be reused frequently so avoiding heap allocations.

src/Serilog.Enrichers.Thread/Enrichers/ThreadNameEnricher.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ namespace Serilog.Enrichers
2121
/// <summary>
2222
/// Enriches log events with a ThreadName property containing the <see cref="Thread.CurrentThread"/> <see cref="Thread.Name"/>.
2323
/// </summary>
24-
public class ThreadNameEnricher : ILogEventEnricher
24+
sealed class ThreadNameEnricher : ILogEventEnricher
2525
{
2626
/// <summary>
2727
/// The property name added to enriched log events.
2828
/// </summary>
29-
public const string ThreadNamePropertyName = "ThreadName";
29+
const string ThreadNamePropertyName = "ThreadName";
3030

3131
/// <summary>
3232
/// The cached last created "ThreadName" property with some thread name. It is likely to be reused frequently so avoiding heap allocations.

0 commit comments

Comments
 (0)