Skip to content

Commit

Permalink
Fix ReSharper warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwcole committed Feb 16, 2021
1 parent 76aaef2 commit 09d255e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
7 changes: 2 additions & 5 deletions src/Gelf.Extensions.Logging/HttpGelfClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,9 @@ public HttpGelfClient(GelfLoggerOptions options)
Timeout = options.HttpTimeout
};

if (options.HttpHeaders != null)
foreach (var header in options.HttpHeaders)
{
foreach (var header in options.HttpHeaders)
{
_httpClient.DefaultRequestHeaders.Add(header.Key, header.Value);
}
_httpClient.DefaultRequestHeaders.Add(header.Key, header.Value);
}
}

Expand Down
5 changes: 4 additions & 1 deletion test/Gelf.Extensions.Logging.Tests/GelfLoggerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
using Microsoft.Extensions.Logging;
using Xunit;

// ReSharper disable TemplateIsNotCompileTimeConstantProblem
// ReSharper disable InconsistentLogPropertyNaming

namespace Gelf.Extensions.Logging.Tests
{
public abstract class GelfLoggerTests : IDisposable
Expand Down Expand Up @@ -39,7 +42,7 @@ public async Task Sends_message_to_Graylog(LogLevel logLevel, int expectedLevel)
var messageText = Faker.Lorem.Sentence();
var sut = LoggerFixture.CreateLogger<GelfLoggerTests>();

sut.Log(logLevel, new EventId(), (object) null, null, (s, e) => messageText);
sut.Log(logLevel, new EventId(), (object) null, null, (_, _) => messageText);

var message = await GraylogFixture.WaitForMessageAsync();

Expand Down
2 changes: 1 addition & 1 deletion test/Gelf.Extensions.Logging.Tests/HttpGelfLoggerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public HttpGelfLoggerTests(HttpGraylogFixture graylogFixture) : base(graylogFixt
Host = GraylogFixture.Host,
Port = graylogFixture.InputPort,
Protocol = GelfProtocol.Http,
LogSource = typeof(HttpGelfLoggerTests).Name
LogSource = nameof(HttpGelfLoggerTests)
}))
{
}
Expand Down
4 changes: 3 additions & 1 deletion test/Gelf.Extensions.Logging.Tests/UdpGelfLoggerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using Microsoft.Extensions.Logging;
using Xunit;

// ReSharper disable TemplateIsNotCompileTimeConstantProblem

namespace Gelf.Extensions.Logging.Tests
{
public class UdpGelfLoggerTests : GelfLoggerTests, IClassFixture<UdpGraylogFixture>
Expand All @@ -13,7 +15,7 @@ public UdpGelfLoggerTests(UdpGraylogFixture graylogFixture) : base(graylogFixtur
Host = GraylogFixture.Host,
Port = graylogFixture.InputPort,
Protocol = GelfProtocol.Udp,
LogSource = typeof(UdpGelfLoggerTests).Name
LogSource = nameof(UdpGelfLoggerTests)
}))
{
}
Expand Down

0 comments on commit 09d255e

Please sign in to comment.