Skip to content

Commit 4dde9ea

Browse files
committed
documentation update to reflect ChannelInformation
1 parent 9eb2dfb commit 4dde9ea

File tree

2 files changed

+16
-19
lines changed

2 files changed

+16
-19
lines changed

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,12 @@ namespace J4JLogger.Examples
4545

4646
var builder = new ContainerBuilder();
4747

48-
var factory = new ChannelFactory( config );
48+
var channelInfo = new ChannelInformation()
49+
.AddChannel<ConsoleConfig>("channels:console")
50+
.AddChannel<DebugConfig>("channels:debug")
51+
.AddChannel<FileConfig>("channels:file");
4952

50-
factory.AddChannel<ConsoleConfig>("channels:console");
51-
factory.AddChannel<DebugConfig>("channels:debug");
52-
factory.AddChannel<FileConfig>("channels:file");
53-
54-
builder.RegisterJ4JLogging<J4JLoggerConfiguration>( factory );
53+
builder.RegisterJ4JLogging<J4JLoggerConfiguration>( new ChannelFactory( config, channelInfo ) );
5554

5655
_svcProvider = new AutofacServiceProvider(builder.Build());
5756
}

docs/configuration.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,16 @@ var config = new ConfigurationBuilder()
1111

1212
var builder = new ContainerBuilder();
1313

14-
var factory = new ChannelFactory( config );
14+
var channelInfo = new ChannelInformation()
15+
.AddChannel<ConsoleConfig>( "channels:console" )
16+
.AddChannel<DebugConfig>( "channels:debug" )
17+
.AddChannel<FileConfig>( "channels:file" );
1518

16-
factory.AddChannel<ConsoleConfig>( "channels:console" );
17-
factory.AddChannel<DebugConfig>( "channels:debug" );
18-
factory.AddChannel<FileConfig>( "channels:file" );
19-
20-
builder.RegisterJ4JLogging<DerivedConfiguration>( factory );
19+
builder.RegisterJ4JLogging<DerivedConfiguration>( new ChannelFactory( config, channelInfo ) );
2120

2221
_svcProvider = new AutofacServiceProvider( builder.Build() );
2322
```
24-
All you do is create an instance of `ChannelFactory` and tell it how to
23+
All you do is create an instance of `ChannelInformation` and tell it how to
2524
locate each of the configuration sections which define the channels you want to
2625
use.
2726

@@ -101,13 +100,12 @@ var config = new ConfigurationBuilder()
101100

102101
var builder = new ContainerBuilder();
103102

104-
var channelFactory = new ChannelFactory( config, "Logger" );
105-
106-
channelFactory.AddChannel<ConsoleConfig>( "Logger:Channels:Console" );
107-
channelFactory.AddChannel<DebugConfig>("Logger:Channels:Debug");
108-
channelFactory.AddChannel<FileConfig>("Logger:Channels:File");
103+
var channelInfo = new ChannelInformation()
104+
.AddChannel<ConsoleConfig>("Logger:channels:console")
105+
.AddChannel<DebugConfig>("Logger:channels:debug")
106+
.AddChannel<FileConfig>("Logger:channels:file");
109107

110-
builder.RegisterJ4JLogging<J4JLoggerConfiguration>( channelFactory );
108+
builder.RegisterJ4JLogging<J4JLoggerConfiguration>( new ChannelFactory( config, channelInfo, "Logger" ) );
111109

112110
_svcProvider = new AutofacServiceProvider(builder.Build());
113111
```

0 commit comments

Comments
 (0)