public void HandleStderr()
        {
            string?message;

            while ((message = _stderr.ReadLine()) != null)
            {
                if (message.StartsWith("error: "))
                {
                    Log.Error("External solver: " + message.Substring("error: ".Length));
                }
                else if (message.StartsWith("warning: "))
                {
                    Log.Warn("External solver: " + message.Substring("warning: ".Length));
                }
                else if (message.StartsWith("info: "))
                {
                    Log.Info("External solver: " + message.Substring("info: ".Length));
                }
                else if (message.StartsWith("debug: "))
                {
                    Log.Debug("External solver: " + message.Substring("debug: ".Length));
                }
                else
                {
                    Log.Debug("External solver: " + message);
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Reads all currently pending <paramref name="stderr"/> lines and sends responses to <paramref name="stdin"/>.
        /// </summary>
        private void HandlePending([NotNull] StreamConsumer stderr, [NotNull] StreamWriter stdin)
        {
            string line;

            while ((line = stderr.ReadLine()) != null)
            {
                string response = HandleStderr(line);
                if (response != null)
                {
                    stdin.WriteLine(response);
                }
            }
        }