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:
4 files changed
+48
-9
No files matched your search
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user