Exemplo n.º 1
0
 public PackRulesCommand(PackRulesOptions opt, ILoggerFactory?loggerFactory = null)
 {
     _options       = opt;
     _logger        = loggerFactory?.CreateLogger <PackRulesCommand>() ?? NullLogger <PackRulesCommand> .Instance;
     _loggerFactory = loggerFactory;
     ConfigRules();
 }
        public PackRulesCommand(PackRulesOptions opt)
        {
            _options = opt;

            try
            {
                _options.Log ??= Utils.SetupLogging(_options);
                WriteOnce.Log ??= _options.Log;

                ConfigureConsoleOutput();
                ConfigRules();
            }
            catch (OpException e)
            {
                WriteOnce.Error(e.Message);
                throw;
            }
        }