Пример #1
0
        public void Run()
        {
            int countOfAppenders = int.Parse(Console.ReadLine());

            for (int i = 0; i < countOfAppenders; i++)
            {
                string [] appCreateArgs = Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries);

                commandInterpreter.AddAppender(appCreateArgs);
            }

            string input = Console.ReadLine();

            while (input != "END")
            {
                string[] commandArgs = input.Split("|", StringSplitOptions.RemoveEmptyEntries);

                try
                {
                    commandInterpreter.AddMessage(commandArgs);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }

                input = Console.ReadLine();
            }


            commandInterpreter.Print();
        }
Пример #2
0
        public void Start()
        {
            int n = int.Parse(Console.ReadLine());

            for (int i = 0; i < n; i++)
            {
                string[] appenderConfig = Console.ReadLine().Split();
                _commandInterpreter.AddAppender(appenderConfig);
            }
            while (true)
            {
                string message = Console.ReadLine();
                if (message == "END")
                {
                    break;
                }
                string[] messageArgs = message.Split("|");
                _commandInterpreter.AddMessage(messageArgs);
            }
        }
Пример #3
0
        public void Run()
        {
            int n = int.Parse(Console.ReadLine());

            for (int i = 0; i < n; i++)
            {
                string[] args = Console.ReadLine().Split();
                commandInterpreter.AddAppender(args);
            }

            string command;

            while ((command = Console.ReadLine()) != "END")
            {
                string[] args = command.Split("|");
                commandInterpreter.ParseCommand(args);
            }

            commandInterpreter.LoggerInfo();
        }
Пример #4
0
        public void Run()
        {
            var n = int.Parse(Console.ReadLine());

            for (int i = 0; i < n; i++)
            {
                var inputArgs = Console.ReadLine().Split();
                commandInterpreter.AddAppender(inputArgs);
            }

            string command;

            while ((command = Console.ReadLine()) != "END")
            {
                var data = command.Split('|', StringSplitOptions.RemoveEmptyEntries);

                this.commandInterpreter.AddMessage(data);
            }

            this.commandInterpreter.PrintInfo();
        }
Пример #5
0
        public void Run()
        {
            var n = int.Parse(Console.ReadLine());

            for (int i = 0; i < n; i++)
            {
                var inputArgs = Console.ReadLine().Split().ToArray();

                commandInterpreter.AddAppender(inputArgs);
            }

            var input = Console.ReadLine();

            while (input != "END")
            {
                var inputArgs = input.Split('|').ToArray();
                commandInterpreter.AddMessage(inputArgs);

                input = Console.ReadLine();
            }

            commandInterpreter.PrintInfo();
        }
Пример #6
0
        public void Run()
        {
            int appendersCount = int.Parse(Console.ReadLine());

            for (int i = 0; i < appendersCount; i++)
            {
                string[] appenderArgs = Console.ReadLine().Split();

                commandInterpreter.AddAppender(appenderArgs);
            }

            string input = Console.ReadLine();

            while (input != "END")
            {
                string[] reportArgs = input.Split("|");
                this.commandInterpreter.AddReport(reportArgs);

                input = Console.ReadLine();
            }

            this.commandInterpreter.PrintInfo();
        }
Пример #7
0
        public void Run()
        {
            int n = int.Parse(Console.ReadLine());

            for (int i = 0; i < n; i++)
            {
                string[] args = Console.ReadLine().Split();

                commandInterpreter.AddAppender(args);
            }

            while (true)
            {
                string[] args = Console.ReadLine().Split("|");
                if (args[0] == "END")
                {
                    break;
                }
                commandInterpreter.AddMessage(args);
            }

            Console.WriteLine("Logger info");
            this.commandInterpreter.PrintInfo();
        }