fix(app): make --capture failures visible in CI

Mirror the log to stderr in capture mode, report how many screenshots
were written, exit non-zero when none were, and print the capture log
in the CI step with a warning annotation when no images are produced.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-02 10:29:51 +00:00
1 parent d3d1c5db0d
commit 2c4a0c1a47
4 files changed
+48 -9

No files matched your search

+20
View File
@@ -114,3 +114,23 @@ public sealed class FileLogSink : ILogSink, IDisposable
lock (_gate) _writer?.Dispose();
}
}
/// <summary>Writes every event to several sinks.</summary>
public sealed class TeeLogSink(params ILogSink[] sinks) : ILogSink
{
public void Write(LogLevel level, string category, string message, Exception? exception)
{
foreach (var sink in sinks) sink.Write(level, category, message, exception);
}
}
/// <summary>Writes events to standard error (CI and command-line diagnostics).</summary>
public sealed class StderrLogSink : ILogSink
{
public void Write(LogLevel level, string category, string message, Exception? exception)
{
var line = string.Create(CultureInfo.InvariantCulture, $"{DateTime.UtcNow:O} {level,-7} {category}: {message}");
if (exception is not null) line += Environment.NewLine + exception;
Console.Error.WriteLine(line);
}
}