Example #1
0
 private void InitializeHtmlReportGenerator(CliArguments arguments)
 {
     generator = new HtmlReportGenerator()
     {
         LogFile      = arguments.Logfile,
         FileName     = arguments.Output,
         TableColumns = arguments.Columns
     };
 }
 private void InitializeHtmlReportGenerator(CliArguments arguments){
     
     generator = new HtmlReportGenerator()
     {
         LogFile = arguments.Logfile, 
         FileName = arguments.Output,
         TableColumns = arguments.Columns
     };
 }
        private void Initialize(CliArguments arguments)
        {
            IEventParser definitions = new JsonEventParser(arguments.Definitions);
            reader = new SimpleLogReader(arguments.Logfile) { EventDefinition = definitions };

            switch (arguments.Format)
            {
                case "stdout":
                    generator = new ConsolePrinter();
                    break;
                case "html":
                    this.InitializeHtmlReportGenerator(arguments);
                    break;
                default:
                    generator = new ConsolePrinter();
                    break;
            }
        }
Example #4
0
        public static int Main(string[] args)
        {
            var arguments = new CliArguments();

            if (Parser.Default.ParseArguments(args, arguments))
            {
                var cli = new CommandLineInterface();

                try
                {
                    cli.Initialize(arguments);
                    cli.generator.CreateReport(cli.reader.GetEventIterator());

                    if (arguments.NumberOfEventsAsReturnCode)
                    {
                        return(cli.reader.GetEventIterator().Count());
                    }
                    return((int)CliReturnCodes.ExecutionSuccessful);
                }
                catch (FileNotFoundException fnf)
                {
                    Console.WriteLine(fnf.Message);
                    return((int)CliReturnCodes.FileNotFound);
                }
                catch (JsonReaderException jre)
                {
                    Console.WriteLine(jre.Message);
                }
            }
            else
            {
                Console.WriteLine("not all mandatory parameters were specified. use --help for further information.");
                return((int)CliReturnCodes.MissingParameters);
            }

            return((int)CliReturnCodes.UnhandledException);
        }
        public static int Main(string[] args)
        {
            var arguments = new CliArguments();
            if (Parser.Default.ParseArguments(args, arguments))
            {

                var cli = new CommandLineInterface();

                try
                {
                    cli.Initialize(arguments);
                    cli.generator.CreateReport(cli.reader.GetEventIterator());

                    if (arguments.NumberOfEventsAsReturnCode)
                    {
                        return cli.reader.GetEventIterator().Count();
                    }
                    return (int) CliReturnCodes.ExecutionSuccessful;
                }
                catch (FileNotFoundException fnf)
                {
                    Console.WriteLine(fnf.Message);
                    return (int) CliReturnCodes.FileNotFound;
                }
                catch (JsonReaderException jre)
                {
                    Console.WriteLine(jre.Message);
                }
            }
            else
            {
                Console.WriteLine("not all mandatory parameters were specified. use --help for further information.");
                return (int) CliReturnCodes.MissingParameters;
            }

            return (int)CliReturnCodes.UnhandledException;
        }
Example #6
0
        private void Initialize(CliArguments arguments)
        {
            IEventParser definitions = new JsonEventParser(arguments.Definitions);

            reader = new SimpleLogReader(arguments.Logfile)
            {
                EventDefinition = definitions
            };

            switch (arguments.Format)
            {
            case "stdout":
                generator = new ConsolePrinter();
                break;

            case "html":
                this.InitializeHtmlReportGenerator(arguments);
                break;

            default:
                generator = new ConsolePrinter();
                break;
            }
        }
Example #7
0
 void InitializeConfigParameters(CliArguments args)
 {
     var configFile = FilesystemIoHelper.GetStreamReader(args.Configuration ?? DefaultConfigurationFile);
 }
        void InitializeConfigParameters(CliArguments args)
        {
            var configFile = FilesystemIoHelper.GetStreamReader(args.Configuration ?? DefaultConfigurationFile);

            
        }