Inheritance: IAnalyzeOptions
        internal AggregatingLogger InitializeLogger(AnalyzeOptionsBase analyzeOptions)
        {
            _tool = Tool.CreateFromAssemblyData();

            var logger = new AggregatingLogger();

            if (!analyzeOptions.Quiet)
            {
                _consoleLogger = new ConsoleLogger(analyzeOptions.Verbose, _tool.Driver.Name)
                {
                    CaptureOutput = _captureConsoleOutput
                };
                logger.Loggers.Add(_consoleLogger);
            }

            if (analyzeOptions.ComputeFileHashes)
            {
                _resultsCachingLogger = new ResultsCachingLogger(analyzeOptions.Verbose);
                logger.Loggers.Add(_resultsCachingLogger);
            }

            if (analyzeOptions.Statistics)
            {
                logger.Loggers.Add(new StatisticsLogger());
            }

            return(logger);
        }
        public static LoggingOptions ConvertToLoggingOptions(this AnalyzeOptionsBase analyzeOptions)
        {
            LoggingOptions loggingOptions = LoggingOptions.None;

            if (analyzeOptions.Verbose)
            {
                loggingOptions |= LoggingOptions.Verbose;
            }
            if (analyzeOptions.PrettyPrint)
            {
                loggingOptions |= LoggingOptions.PrettyPrint;
            }
            if (analyzeOptions.LogEnvironment)
            {
                loggingOptions |= LoggingOptions.PersistEnvironment;
            }
            if (analyzeOptions.ComputeFileHashes)
            {
                loggingOptions |= LoggingOptions.ComputeFileHashes;
            }
            if (analyzeOptions.PersistFileContents)
            {
                loggingOptions |= LoggingOptions.PersistFileContents;
            }

            return(loggingOptions);
        }
        public static LoggingOptions ConvertToLoggingOptions(this AnalyzeOptionsBase analyzeOptions)
        {
            LoggingOptions loggingOptions = LoggingOptions.PrettyPrint;

            if (analyzeOptions.Force)
            {
                loggingOptions |= LoggingOptions.OverwriteExistingOutputFile;
            }
            if (analyzeOptions.Minify)
            {
                loggingOptions ^= LoggingOptions.PrettyPrint;
            }
            if (analyzeOptions.Verbose)
            {
                loggingOptions |= LoggingOptions.Verbose;
            }
            if (analyzeOptions.Optimize)
            {
                loggingOptions |= LoggingOptions.Optimize;
            }
            if (analyzeOptions.PrettyPrint)
            {
                loggingOptions |= LoggingOptions.PrettyPrint;
            }

            return(loggingOptions);
        }
        public static bool ValidateOutputOptions(this AnalyzeOptionsBase options)
        {
            bool valid = true;

            valid &= !(options.Quiet && string.IsNullOrWhiteSpace(options.OutputFilePath));

            return(valid);
        }
示例#5
0
        internal AggregatingLogger InitializeLogger(AnalyzeOptionsBase analyzeOptions)
        {
            var logger = new AggregatingLogger();

            if (!analyzeOptions.Quiet)
            {
                logger.Loggers.Add(new ConsoleLogger(analyzeOptions.Verbose));
            }

            if (analyzeOptions.Statistics)
            {
                logger.Loggers.Add(new StatisticsLogger());
            }

            return(logger);
        }
        internal AggregatingLogger InitializeLogger(AnalyzeOptionsBase analyzeOptions)
        {
            _tool = Tool.CreateFromAssemblyData();

            var logger = new AggregatingLogger();

            if (!analyzeOptions.Quiet)
            {
                _consoleLogger = new ConsoleLogger(analyzeOptions.Quiet, _tool.Driver.Name, analyzeOptions.Level, analyzeOptions.Kind)
                {
                    CaptureOutput = _captureConsoleOutput
                };
                logger.Loggers.Add(_consoleLogger);
            }

            return(logger);
        }
示例#7
0
        internal AggregatingLogger InitializeLogger(AnalyzeOptionsBase analyzeOptions)
        {
            _tool = Tool.CreateFromAssemblyData();

            var logger = new AggregatingLogger();

            if (!analyzeOptions.Quiet)
            {
                _consoleLogger = new ConsoleLogger(analyzeOptions.Verbose, _tool.Driver.Name)
                {
                    CaptureOutput = _captureConsoleOutput
                };
                logger.Loggers.Add(_consoleLogger);
            }

            if ((analyzeOptions.DataToInsert.ToFlags() & OptionallyEmittedData.Hashes) != 0)
            {
                _cacheByFileHashLogger = new CacheByFileHashLogger(analyzeOptions.Verbose);
                logger.Loggers.Add(_cacheByFileHashLogger);
            }

            return(logger);
        }
示例#8
0
 public int Run(AnalyzeOptionsBase options)
 {
     return(base.Run((TestAnalyzeOptions)options));
 }