18 lines
414 B
C#
18 lines
414 B
C#
using System;
|
|
|
|
namespace DotnetStandardStreams
|
|
{
|
|
public class ProcessedConsoleOutputTarget : ConsoleOutputTarget
|
|
{
|
|
private readonly Func<string, string> _processorFunc;
|
|
|
|
public ProcessedConsoleOutputTarget(Func<string, string> processorFunc) => _processorFunc = processorFunc;
|
|
|
|
public override void Output(string line)
|
|
{
|
|
string output = _processorFunc(line);
|
|
Console.WriteLine(output);
|
|
}
|
|
}
|
|
}
|