Skip to content

Commit b313808

Browse files
committed
Some general cleanup
1 parent e8cbe1e commit b313808

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

sample/ConsoleDemo/Program.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
using Serilog;
1+
using Serilog;
22
using System;
3-
using System.Threading;
43
using Exceptionless;
54
using Serilog.Sinks.SystemConsole.Themes;
65

@@ -21,7 +20,7 @@ public static void Main()
2120
try
2221
{
2322
Log.Debug("Getting started");
24-
Log.Information("Hello {Name} from thread {ThreadId}", Environment.GetEnvironmentVariable("USERNAME"), Thread.CurrentThread.ManagedThreadId);
23+
Log.Information("Hello {Name} from thread {ThreadId}", Environment.GetEnvironmentVariable("USERNAME"), Environment.CurrentManagedThreadId);
2524
Log.Warning("No coins remain at position {@Position}", new { Lat = 25, Long = 134 });
2625

2726
Fail();

sample/SampleWeb/Controllers/ValuesController.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace SampleWeb.Controllers
1313
public class ValuesController : ControllerBase
1414
{
1515
private readonly ILogger<ValuesController> _logger;
16-
16+
1717
public ValuesController(ILogger<ValuesController> logger)
1818
{
1919
_logger = logger;
@@ -25,7 +25,7 @@ public string Get()
2525
_logger.LogInformation("Get was called");
2626
return $"[{Activity.Current?.Id}] {User.Identity?.Name}";
2727
}
28-
28+
2929
[HttpGet("advanced-topic-user")]
3030
public string AdvancedTopicUser()
3131
{
@@ -35,18 +35,18 @@ public string AdvancedTopicUser()
3535
using (LogContext.PushProperty(Event.KnownDataKeys.UserInfo, new UserInfo(User.Identity?.Name + " Custom", "Test User Full Name"), true)) {
3636
_logger.LogInformation("This log event will have a custom user set.");
3737
}
38-
38+
3939
return $"[{Activity.Current?.Id}] {User.Identity?.Name}";
4040
}
41-
41+
4242
[HttpGet("advanced-topic-user-description")]
4343
public string AdvancedTopicUserDescription(string description)
4444
{
4545
// User descriptions was intended to provide a description from an end user why an error happened.
4646
using (LogContext.PushProperty(Event.KnownDataKeys.UserDescription, new UserDescription(User.Identity?.Name, description), true)) {
4747
_logger.LogError(new Exception("Test"), "This error event will have a user description set on it.");
4848
}
49-
49+
5050
return $"[{Activity.Current?.Id}] {User.Identity?.Name}";
5151
}
5252
}

src/Serilog.Sinks.Exceptionless/Sinks/Exceptionless/ExceptionlessSink.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public void Emit(LogEvent logEvent) {
104104

105105
var builder = _client.CreateFromLogEvent(logEvent).AddTags(_defaultTags);
106106

107-
if (_includeProperties && logEvent.Properties != null) {
107+
if (_includeProperties) {
108108
foreach (var prop in logEvent.Properties)
109109
{
110110
switch (prop.Key)

0 commit comments

Comments
 (0)