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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user