static GrandOutputConfiguration CreateDefaultConfig( string subFolder ) { GrandOutputConfiguration def = new GrandOutputConfiguration(); Debug.Assert( def.SourceOverrideFilterApplicationMode == SourceFilterApplyMode.None ); Debug.Assert( def.GlobalDefaultFilter == null ); var route = new RouteConfiguration(); route.ConfigData = new GrandOutputChannelConfigData(); route.AddAction( new BinaryFileConfiguration( "All" ) { Path = subFolder } ); def.ChannelsConfiguration = route; return def; }
RouteConfiguration FillRoute( IActivityMonitor monitor, XElement xml, RouteConfiguration route ) { route.ConfigData = new GrandOutputChannelConfigData( xml ); foreach( var e in xml.Elements() ) { switch( e.Name.LocalName ) { case "Channel": route.DeclareRoute( FillSubRoute( monitor, e, new SubRouteConfiguration( e.AttributeRequired( "Name" ).Value, null ) ) ); break; case "Parallel": case "Sequence": case "Add": DoSequenceOrParallelOrAdd( monitor, a => route.AddAction( a ), e ); break; default: throw new XmlException( "Element name must be <Add>, <Parallel>, <Sequence> or <Channel>." + e.GetLineColumnString() ); } } return route; }
static GrandOutputConfiguration CreateDefaultConfig() { GrandOutputConfiguration def = new GrandOutputConfiguration(); Debug.Assert( def.SourceOverrideFilterApplicationMode == SourceFilterApplyMode.None ); Debug.Assert( def.GlobalDefaultFilter == null ); var route = new RouteConfiguration(); route.ConfigData = new GrandOutputChannelConfigData() { MinimalFilter = LogFilter.Debug }; route.AddAction( new TextFileConfiguration( "All" ) { Path = "GrandOutputDefault" } ); def.ChannelsConfiguration = route; return def; }