2023-04-13 09:30:19 +00:00
|
|
|
|
using KubernetesWorkflow;
|
|
|
|
|
using Logging;
|
|
|
|
|
|
2023-04-14 07:54:07 +00:00
|
|
|
|
namespace DistTestCore.Logs
|
2023-04-13 09:30:19 +00:00
|
|
|
|
{
|
2023-04-17 08:31:14 +00:00
|
|
|
|
public class LogDownloadHandler : LogHandler, ILogHandler
|
2023-04-13 09:30:19 +00:00
|
|
|
|
{
|
2023-06-27 13:28:00 +00:00
|
|
|
|
private readonly RunningContainer container;
|
2023-04-13 09:30:19 +00:00
|
|
|
|
private readonly LogFile log;
|
|
|
|
|
|
2023-06-27 13:28:00 +00:00
|
|
|
|
public LogDownloadHandler(RunningContainer container, string description, LogFile log)
|
2023-04-13 09:30:19 +00:00
|
|
|
|
{
|
2023-06-27 13:28:00 +00:00
|
|
|
|
this.container = container;
|
2023-04-13 09:30:19 +00:00
|
|
|
|
this.log = log;
|
2023-04-17 08:31:14 +00:00
|
|
|
|
|
|
|
|
|
log.Write($"{description} -->> {log.FullFilename}");
|
|
|
|
|
log.WriteRaw(description);
|
2023-04-13 09:30:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-06-27 13:28:00 +00:00
|
|
|
|
public DownloadedLog DownloadLog()
|
2023-04-13 09:30:19 +00:00
|
|
|
|
{
|
2023-06-27 13:28:00 +00:00
|
|
|
|
return new DownloadedLog(log, container.Name);
|
2023-04-13 09:30:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-04-17 08:31:14 +00:00
|
|
|
|
protected override void ProcessLine(string line)
|
2023-04-13 09:30:19 +00:00
|
|
|
|
{
|
2023-04-17 08:31:14 +00:00
|
|
|
|
log.WriteRaw(line);
|
2023-04-13 09:30:19 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|