Add support for recording console output

This commit adds support for recording console output
as well as exporting it to either text or HTML. A user can
also provide their own encoder if they wish.
This commit is contained in:
Patrik Svensson
2020-09-21 00:44:47 +02:00
committed by Patrik Svensson
parent b197f278ed
commit cd0d182f12
16 changed files with 481 additions and 24 deletions

View File

@@ -21,10 +21,12 @@ namespace Spectre.Console
return console;
});
private static Recorder? _recorder;
/// <summary>
/// Gets the underlying <see cref="IAnsiConsole"/>.
/// </summary>
public static IAnsiConsole Console => _console.Value;
public static IAnsiConsole Console => _recorder ?? _console.Value;
/// <summary>
/// Gets the console's capabilities.