Skip to content

Commit 6998b65

Browse files
committed
Some more cleanup (reduced nesting)
1 parent 8475be8 commit 6998b65

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

Source/Platforms/Log4net/BufferingExceptionlessAppender.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,26 @@ public class BufferingExceptionlessAppender : BufferingAppenderSkeleton {
1010
public string ServerUrl { get; set; }
1111

1212
protected override void SendBuffer(LoggingEvent[] events) {
13-
foreach (var e in events) {
13+
foreach (var e in events)
1414
_client.SubmitFromLogEvent(e);
15-
}
1615
}
1716

1817
public override void ActivateOptions() {
1918
base.ActivateOptions();
20-
if (!String.IsNullOrEmpty(ApiKey) || !String.IsNullOrEmpty(ServerUrl))
21-
_client = new ExceptionlessClient(config =>
22-
{
23-
if (!String.IsNullOrEmpty(ApiKey))
24-
config.ApiKey = ApiKey;
25-
if (!String.IsNullOrEmpty(ServerUrl))
26-
config.ServerUrl = ServerUrl;
27-
config.UseInMemoryStorage();
28-
});
19+
20+
if (String.IsNullOrEmpty(ApiKey) && String.IsNullOrEmpty(ServerUrl))
21+
return;
22+
23+
_client = new ExceptionlessClient(config => {
24+
if (!String.IsNullOrEmpty(ApiKey))
25+
config.ApiKey = ApiKey;
26+
if (!String.IsNullOrEmpty(ServerUrl))
27+
config.ServerUrl = ServerUrl;
28+
config.UseInMemoryStorage();
29+
});
2930
}
3031

31-
protected override void Append(LoggingEvent loggingEvent)
32-
{
32+
protected override void Append(LoggingEvent loggingEvent) {
3333
if (!_client.Configuration.IsValid)
3434
return;
3535

0 commit comments

Comments
 (0)