Skip to content

Commit 3440e65

Browse files
Changes to resprect code style
Extra lines removed Curly braces position fixed (new line not same line) Variable name used instead of property of Thread.
1 parent 764ae5a commit 3440e65

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,19 @@
1717
using Serilog.Core;
1818
using Serilog.Events;
1919

20-
namespace Serilog.Enrichers {
20+
namespace Serilog.Enrichers
21+
{
2122
#if NET45 || NETSTANDARD2_0
2223
/// <summary>
2324
/// Enriches log events with a ThreadName property containing the
2425
/// </summary>
2526
public class ThreadNameEnricher : ILogEventEnricher
2627
{
27-
2828
/// <summary>
2929
/// The property name added to enriched log events.
3030
/// </summary>
3131
public const string ThreadNamePropertyName = "ThreadName";
3232

33-
3433
/// <summary>
3534
/// Enrich the log event.
3635
/// </summary>
@@ -41,7 +40,7 @@ public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
4140
var threadName = Thread.CurrentThread.Name;
4241
if (threadName != null)
4342
{
44-
logEvent.AddPropertyIfAbsent(new LogEventProperty(ThreadNamePropertyName, new ScalarValue(Thread.CurrentThread.Name)));
43+
logEvent.AddPropertyIfAbsent(new LogEventProperty(ThreadNamePropertyName, new ScalarValue(threadName)));
4544
}
4645
}
4746
}

0 commit comments

Comments
 (0)