Skip to content

Commit

Permalink
fix UseRollingDevLogManifestFiles defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
wickedmachinator committed Jan 18, 2024
1 parent 557a9fb commit 0fa2d11
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion EtLast.ConsoleHost/ConsoleHost.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using FizzCode.EtLast.HostBuilder;
using static FizzCode.EtLast.ConsoleHostFluent;

namespace FizzCode.EtLast;

Expand Down Expand Up @@ -45,7 +46,7 @@ public string HostArgumentsFolder
}

[EditorBrowsable(EditorBrowsableState.Never)]
public Action<ISessionBuilder, IArgumentCollection> SessionConfigurator { get; internal set; }
public SessionBuilderAction SessionConfigurator { get; internal set; }

public ConsoleHost(string name)
: base(name)
Expand Down
4 changes: 3 additions & 1 deletion EtLast.ConsoleHost/ConsoleHostFluent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ public static T SetModuleCompilationMode<T>(this T host, ModuleCompilationMode m
return host;
}

public static T ConfigureSession<T>(this T host, Action<ISessionBuilder, IArgumentCollection> builderAction)
public delegate void SessionBuilderAction(ISessionBuilder builder, IArgumentCollection sessionArguments);

public static T ConfigureSession<T>(this T host, SessionBuilderAction builderAction)
where T : ConsoleHost
{
host.SessionConfigurator = builderAction;
Expand Down
2 changes: 1 addition & 1 deletion EtLast.ConsoleHost/ConsoleHostSessionBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions Samples/Sample.Etl.Host/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.UseCommandListener(hostArguments => new ConsoleCommandListener())
.SetAlias("test", "test-modules -a")
.SetAlias("load", "run SampleModule Load")
.ConfigureSession((builder, sessionArguments) => builder.UseRollingDevLogManifestFiles())
.Run();
2 changes: 1 addition & 1 deletion Tests/EtLast.Tests.Integration/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0fa2d11

Please sign in to comment.