Skip to content

Commit 51b3543

Browse files
Code refactor updates
Co-authored-by: Mauro Servienti <[email protected]>
1 parent fae9759 commit 51b3543

File tree

4 files changed

+5
-20
lines changed

4 files changed

+5
-20
lines changed

samples/logging/custom-factory/Core_10/Sample/ConsoleLoggerDefinition.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ public void Level(LogLevel level)
1111
this.level = level;
1212
}
1313

14-
protected override ILoggerFactory GetLoggingFactory()
15-
{
16-
return new ConsoleLoggerFactory(level);
17-
}
14+
protected override ILoggerFactory GetLoggingFactory() => new ConsoleLoggerFactory(level);
1815
}
1916
#endregion

samples/logging/custom-factory/Core_10/Sample/ConsoleLoggerFactory.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,8 @@
55
class ConsoleLoggerFactory(LogLevel level) :
66
ILoggerFactory
77
{
8-
public ILog GetLogger(Type type)
9-
{
10-
return GetLogger(type.FullName);
11-
}
12-
13-
public ILog GetLogger(string name)
14-
{
15-
return new ConsoleLog(name, level);
16-
}
8+
public ILog GetLogger(Type type) => GetLogger(type.FullName);
9+
public ILog GetLogger(string name) => new ConsoleLog(name, level);
1710
}
1811

1912
#endregion
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
using NServiceBus;
22

3-
public class MyMessage :
4-
IMessage
5-
{
6-
}
3+
public class MyMessage : IMessage;

samples/logging/custom-factory/Core_10/Sample/Program.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111
#region ConfigureLogging
1212
var loggerDefinition = LogManager.Use<ConsoleLoggerDefinition>();
1313
loggerDefinition.Level(LogLevel.Info);
14-
15-
var endpointConfiguration = new EndpointConfiguration("Samples.Logging.CustomFactory");
16-
1714
#endregion
15+
var endpointConfiguration = new EndpointConfiguration("Samples.Logging.CustomFactory");
1816
endpointConfiguration.UseSerialization<SystemJsonSerializer>();
1917
endpointConfiguration.UseTransport<LearningTransport>();
2018

0 commit comments

Comments
 (0)