Esempio n. 1
0
        private void SetupLogFile()
        {
            _architectureExplorer = new ArchitectureExplorer(this);

            if (_architectureExplorer.IsUnix())
            {
                _loggerQueue.Enqueue("Setting up logging directories and file.");
                _dirPath = _architectureExplorer.ArchRootPath(_unixLoc);
            }
            else
            {
                _loggerQueue.Enqueue("Setting up logging directories and file.");
                _dirPath = _architectureExplorer.ArchRootPath(_winLoc);
            }

            if (!File.Exists(_dirPath))
            {
                try
                {
                    Directory.CreateDirectory(_dirPath);
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Could not Create log file. " + ex);
                    Console.WriteLine("Exiting Program... Try running as admin.");
                    Environment.Exit(0);
                }
            }

            _logWriter = new StreamWriter(_dirPath + "ForexTrader.log", true);
        }
Esempio n. 2
0
 public Menu(ILogger logger, ICollector collector)
 {
     RetrievedAccSettings = false;
     _logger               = logger;
     _collector            = collector;
     _menuLib              = new MenuLib(_logger);
     _architectureExplorer = new ArchitectureExplorer(_logger);
 }