diff --git a/EtLast.ConsoleHost/ConsoleHost.cs b/EtLast.ConsoleHost/ConsoleHost.cs index 0b086fac..956d717e 100644 --- a/EtLast.ConsoleHost/ConsoleHost.cs +++ b/EtLast.ConsoleHost/ConsoleHost.cs @@ -1,4 +1,5 @@ using FizzCode.EtLast.HostBuilder; +using static FizzCode.EtLast.ConsoleHostFluent; namespace FizzCode.EtLast; @@ -45,7 +46,7 @@ public string HostArgumentsFolder } [EditorBrowsable(EditorBrowsableState.Never)] - public Action SessionConfigurator { get; internal set; } + public SessionBuilderAction SessionConfigurator { get; internal set; } public ConsoleHost(string name) : base(name) diff --git a/EtLast.ConsoleHost/ConsoleHostFluent.cs b/EtLast.ConsoleHost/ConsoleHostFluent.cs index 639682d0..1b9af843 100644 --- a/EtLast.ConsoleHost/ConsoleHostFluent.cs +++ b/EtLast.ConsoleHost/ConsoleHostFluent.cs @@ -38,7 +38,9 @@ public static T SetModuleCompilationMode(this T host, ModuleCompilationMode m return host; } - public static T ConfigureSession(this T host, Action builderAction) + public delegate void SessionBuilderAction(ISessionBuilder builder, IArgumentCollection sessionArguments); + + public static T ConfigureSession(this T host, SessionBuilderAction builderAction) where T : ConsoleHost { host.SessionConfigurator = builderAction; diff --git a/EtLast.ConsoleHost/ConsoleHostSessionBuilderExtensions.cs b/EtLast.ConsoleHost/ConsoleHostSessionBuilderExtensions.cs index e6f78af2..20d37229 100644 --- a/EtLast.ConsoleHost/ConsoleHostSessionBuilderExtensions.cs +++ b/EtLast.ConsoleHost/ConsoleHostSessionBuilderExtensions.cs @@ -3,7 +3,7 @@ [EditorBrowsable(EditorBrowsableState.Never)] public static class ConsoleHostSessionBuilderExtensions { - public static ISessionBuilder UseRollingDevLogManifestFiles(this ISessionBuilder session, int? maxFileCount, int? maxSizeOnDisk = 16 * 1024 * 1024) + public static ISessionBuilder UseRollingDevLogManifestFiles(this ISessionBuilder session, int? maxFileCount = null, int? maxSizeOnDisk = 64 * 1024 * 1024) { var folder = Path.Combine(session.DevLogFolder, "manifest"); CleanupManifestFolder(maxFileCount, maxSizeOnDisk, folder); diff --git a/Samples/Sample.Etl.Host/Program.cs b/Samples/Sample.Etl.Host/Program.cs index 2f91b970..0637f572 100644 --- a/Samples/Sample.Etl.Host/Program.cs +++ b/Samples/Sample.Etl.Host/Program.cs @@ -4,4 +4,5 @@ .UseCommandListener(hostArguments => new ConsoleCommandListener()) .SetAlias("test", "test-modules -a") .SetAlias("load", "run SampleModule Load") + .ConfigureSession((builder, sessionArguments) => builder.UseRollingDevLogManifestFiles()) .Run(); diff --git a/Tests/EtLast.Tests.Integration/Program.cs b/Tests/EtLast.Tests.Integration/Program.cs index 99f87d9a..d1a2b1d0 100644 --- a/Tests/EtLast.Tests.Integration/Program.cs +++ b/Tests/EtLast.Tests.Integration/Program.cs @@ -20,7 +20,7 @@ //.DisableSerilogForModules() //.DisableSerilogForCommands() - .ConfigureSession((builder, args) => builder.UseRollingDevLogManifestFiles(null)) + .ConfigureSession((builder, sessionArguments) => builder.UseRollingDevLogManifestFiles(null)) .IfInstanceIs("WSDEVONE", host => host .IfDebuggerAttached(host => host