mirror of
https://github.com/actions/runner.git
synced 2025-12-11 04:46:58 +00:00
Add Header/Footer to multi-line message in StdoutTraceListener. (#2336)
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
using GitHub.Runner.Sdk;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using GitHub.Runner.Sdk;
|
||||||
|
|
||||||
namespace GitHub.Runner.Common
|
namespace GitHub.Runner.Common
|
||||||
{
|
{
|
||||||
@@ -24,9 +24,16 @@ namespace GitHub.Runner.Common
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteHeader(source, eventType, id);
|
if (!string.IsNullOrEmpty(message))
|
||||||
WriteLine(message);
|
{
|
||||||
WriteFooter(eventCache);
|
var messageLines = message.Split(Environment.NewLine);
|
||||||
|
foreach (var messageLine in messageLines)
|
||||||
|
{
|
||||||
|
WriteHeader(source, eventType, id);
|
||||||
|
WriteLine(messageLine);
|
||||||
|
WriteFooter(eventCache);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal bool IsEnabled(TraceOptions opts)
|
internal bool IsEnabled(TraceOptions opts)
|
||||||
@@ -87,4 +94,3 @@ namespace GitHub.Runner.Common
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user