@@ -11,17 +11,16 @@ var config = new ConfigurationBuilder()
1111
1212var 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
2524locate each of the configuration sections which define the channels you want to
2625use.
2726
@@ -101,13 +100,12 @@ var config = new ConfigurationBuilder()
101100
102101var 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