review(Driver.AbLegacy.Cli): add FlushLogging() to command finally blocks

Re-review at 7286d320. -008 (Low): all four commands now FlushLogging() in finally (parity
with AbCip.Cli; subscribe could drop shutdown log lines) + IL-inspection test.
This commit is contained in:
Joseph Doherty
2026-06-19 12:08:45 -04:00
parent 111d6983a5
commit b50fd6c34a
6 changed files with 143 additions and 4 deletions
@@ -58,6 +58,9 @@ public sealed class ProbeCommand : AbLegacyCommandBase
finally
{
await driver.ShutdownAsync(CancellationToken.None);
// Driver.AbLegacy.Cli-008 — flush Serilog before process exit so buffered
// log output emitted during driver shutdown is not lost.
FlushLogging();
}
}
}
@@ -52,6 +52,9 @@ public sealed class ReadCommand : AbLegacyCommandBase
finally
{
await driver.ShutdownAsync(CancellationToken.None);
// Driver.AbLegacy.Cli-008 — flush Serilog before process exit so buffered
// log output emitted during driver shutdown is not lost.
FlushLogging();
}
}
@@ -93,6 +93,11 @@ public sealed class SubscribeCommand : AbLegacyCommandBase
catch { /* teardown best-effort */ }
}
await driver.ShutdownAsync(CancellationToken.None);
// Driver.AbLegacy.Cli-008 — flush Serilog before process exit so buffered
// log output emitted during driver shutdown is not lost. Particularly
// important here: subscribe runs until Ctrl+C; without this, lines logged
// during shutdown can be silently dropped.
FlushLogging();
}
}
}
@@ -62,6 +62,9 @@ public sealed class WriteCommand : AbLegacyCommandBase
finally
{
await driver.ShutdownAsync(CancellationToken.None);
// Driver.AbLegacy.Cli-008 — flush Serilog before process exit so buffered
// log output emitted during driver shutdown is not lost.
FlushLogging();
}
}