If not running cli add back console output

This commit is contained in:
glax 2023-07-31 00:43:57 +02:00
parent 5b89cbd042
commit 18134cdf01
2 changed files with 3 additions and 1 deletions

View File

@ -9,7 +9,7 @@ public class CommonObjects
{ {
public HashSet<LibraryManager> libraryManagers { get; init; } public HashSet<LibraryManager> libraryManagers { get; init; }
public HashSet<NotificationManager> notificationManagers { get; init; } public HashSet<NotificationManager> notificationManagers { get; init; }
public Logger? logger { get; init; } public Logger? logger { get; set; }
[JsonIgnore]private string settingsFilePath { get; init; } [JsonIgnore]private string settingsFilePath { get; init; }
public CommonObjects(HashSet<LibraryManager>? libraryManagers, HashSet<NotificationManager>? notificationManagers, Logger? logger, string settingsFilePath) public CommonObjects(HashSet<LibraryManager>? libraryManagers, HashSet<NotificationManager>? notificationManagers, Logger? logger, string settingsFilePath)

View File

@ -51,6 +51,8 @@ public static class Tranga
if(!RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) if(!RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
TaskMode(taskManager, logger); TaskMode(taskManager, logger);
else
taskManager.commonObjects.logger = new(new[] { Logger.LoggerType.FileLogger, Logger.LoggerType.ConsoleLogger }, Console.Out, Console.Out.Encoding, logFilePath);
} }
private static void TaskMode(TaskManager taskManager, Logger logger) private static void TaskMode(TaskManager taskManager, Logger logger)