Changed default log-folder path, and log-encoding to utf8

This commit is contained in:
2023-08-31 17:06:57 +02:00
parent 89c5f4b820
commit 3167f6c3e6
2 changed files with 12 additions and 6 deletions

View File

@ -41,9 +41,10 @@ internal sealed class TrangaCli : Command<TrangaCli.Settings>
public override int Execute([NotNull] CommandContext context, [NotNull] Settings settings)
{
List<Logger.LoggerType> enabledLoggers = new();
if(settings.fileLogger.HasValue && settings.fileLogger.Value == true)
if(settings.fileLogger is true)
enabledLoggers.Add(Logger.LoggerType.FileLogger);
string? logFilePath = settings.fileLoggerPath ?? "";//TODO path
string? logFilePath = settings.fileLoggerPath ?? "";
Logger logger = new(enabledLoggers.ToArray(), Console.Out, Console.OutputEncoding, logFilePath);
TrangaSettings trangaSettings = new (settings.downloadLocation, settings.workingDirectory, settings.apiPort);