Small changes.

This commit is contained in:
Lucca Faria Ferri 2023-06-12 04:59:57 -03:00
parent be4a31a5f7
commit 4349b829be

View File

@ -324,13 +324,12 @@ namespace DiIiS_NA
Environment.Exit(exception is null ? 0 : -1); Environment.Exit(exception is null ? 0 : -1);
} }
[HandleProcessCorruptedStateExceptions]
[SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.ControlAppDomain)]
static async Task Main(string[] args) static async Task Main(string[] args)
{ {
args ??= Array.Empty<string>();
try try
{ {
args ??= Array.Empty<string>();
await StartAsync(args); await StartAsync(args);
} }
catch (Exception ex) catch (Exception ex)
@ -340,7 +339,6 @@ namespace DiIiS_NA
} }
[SecurityCritical] [SecurityCritical]
[HandleProcessCorruptedStateExceptionsAttribute]
private static void UnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs e) private static void UnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs e)
{ {
var ex = e.ExceptionObject as Exception; var ex = e.ExceptionObject as Exception;
@ -361,17 +359,8 @@ namespace DiIiS_NA
if (TargetsEnabled("ansi") > 1 || (IsTargetEnabled("console") && IsTargetEnabled("ansi"))) if (TargetsEnabled("ansi") > 1 || (IsTargetEnabled("console") && IsTargetEnabled("ansi")))
{ {
AnsiConsole.MarkupLine("[underline red on white]Fatal:[/] [red]You can't use both ansi and console targets at the same time, nor have more than one ansi target.[/]"); AnsiConsole.MarkupLine("[underline red on white]Fatal:[/] [red]It is impossible to have both ANSI and Console targets activated concurrently.[/]");
AnsiConsole.Progress().Start(ctx => Shutdown();
{
var sd = ctx.AddTask("[red3_1]Shutting down[/]");
for (int i = 0; i < 100; i++)
{
sd.Increment(1);
Thread.Sleep(25);
}
});
Environment.Exit(-1);
} }
foreach (var targetConfig in LogConfig.Instance.Targets) foreach (var targetConfig in LogConfig.Instance.Targets)
{ {