protected override void HandleMessage(ConsoleOut c)
        {
            if (!ElasticsearchConsoleOutParser.TryParse(c,
                                                        out string date, out string level, out string section, out string node, out string message, out bool started))
            {
                return;
            }

            if (this.Started || string.IsNullOrWhiteSpace(message))
            {
                return;
            }

            if (!started)
            {
                return;
            }
            this.RunningState = RunningState.ConfirmedStarted;
            this.StartedHandle.Set();
        }
        public override void Write(ConsoleOut c)
        {
            var w = c.Error ? Console.Error : Console.Out;

            if (this._interactive && ElasticsearchConsoleOutParser.TryParse(c,
                                                                            out string date, out string level, out string section, out string node, out string message, out bool started))
            {
                WriteBlock(w, ConsoleColor.DarkGray, date);
                WriteBlock(w, LevelColor(level), level, 5);

                if (!string.IsNullOrWhiteSpace(section))
                {
                    WriteBlock(w, ConsoleColor.DarkCyan, section, 25);
                    WriteSpace(w);
                }
                WriteBlock(w, ConsoleColor.DarkGreen, node);
                WriteSpace(w);

                var messageColor = c.Error || level == "ERROR" ? ConsoleColor.Red : ConsoleColor.White;
                WriteMessage(w, messageColor, message);
            }
Exemplo n.º 3
0
        protected override void HandleMessage(ConsoleOut c)
        {
            if (!ElasticsearchConsoleOutParser.TryParse(c,
                                                        out string date, out string level, out string section, out string node, out string message, out bool started))
            {
                return;
            }

            if (this.Started || string.IsNullOrWhiteSpace(message))
            {
                return;
            }

            if (!started)
            {
                return;
            }
            this.BlockingSubject.OnNext(this.StartedHandle);
            this.Started = true;
            this.StartedHandle.Set();
        }