mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Add serilog for handling verbose and debug outputs.
This commit is contained in:
@@ -52,35 +52,6 @@ sealed class EntropyCommand : Command<EntropyCommand.Settings>
|
||||
{
|
||||
MainClass.PrintCopyright();
|
||||
|
||||
if(settings.Debug)
|
||||
{
|
||||
IAnsiConsole stderrConsole = AnsiConsole.Create(new AnsiConsoleSettings
|
||||
{
|
||||
Out = new AnsiConsoleOutput(System.Console.Error)
|
||||
});
|
||||
|
||||
AaruConsole.DebugWriteLineEvent += (format, objects) =>
|
||||
{
|
||||
if(objects is null)
|
||||
stderrConsole.MarkupLine(format);
|
||||
else
|
||||
stderrConsole.MarkupLine(format, objects);
|
||||
};
|
||||
|
||||
AaruConsole.WriteExceptionEvent += ex => { stderrConsole.WriteException(ex); };
|
||||
}
|
||||
|
||||
if(settings.Verbose)
|
||||
{
|
||||
AaruConsole.WriteEvent += (format, objects) =>
|
||||
{
|
||||
if(objects is null)
|
||||
AnsiConsole.Markup(format);
|
||||
else
|
||||
AnsiConsole.Markup(format, objects);
|
||||
};
|
||||
}
|
||||
|
||||
Statistics.AddCommand("entropy");
|
||||
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "--debug={0}", settings.Debug);
|
||||
|
||||
Reference in New Issue
Block a user