// Public methods ---------------------------------------------------------------------------------------------------------------------------------- public void StartLoggerLogic(bool isTest = false) { if (!isTest) { _helperService.ClearConsoleAndWriteMessage("Where do you want to log your message : \n3 destinations : Registry, EventViewer and File.txt -> press '3' \nOnly to File.txt -> press '1'"); char logDestination = char.ToLower(Console.ReadKey().KeyChar); if (logDestination.Equals('1') || logDestination.Equals('3')) { _helperService.ClearConsoleAndWriteMessage("Please, type the name/ID of your message"); string givenLogName = Console.ReadLine(); _helperService.ClearConsoleAndWriteMessage("Please, type your message"); string givenContent = Console.ReadLine(); _helperService.EnsureThatActionSucceed(() => { if (logDestination.Equals('1')) { logToFile(givenLogName, givenContent); } else { logToAllDestinations(givenLogName, givenContent); } Console.ReadKey(); ChooseNewAction(); }, null, "Could not run logger properly"); } else { _helperService.ClearConsoleAndWriteMessage("Incorret choice"); logicFailed = true; Thread.Sleep(1000); ChooseNewAction(); } } }