/// <summary> /// Outputs the message. /// </summary> /// <param name="message">The message.</param> public override void OutputMessage(P4Message message) { _P4Result.AddP4Message(message); //Console.WriteLine("{0}: {1}", (int)message.Severity, message.Identity); switch (message.Severity) { case P4MessageSeverity.Empty: // E_EMPTY (0) | no error _P4Result.AddString(message.Format()); break; case P4MessageSeverity.Info: // E_INFO (1) | information, not necessarily an error _P4Result.AddInfo(message.Format()); break; case P4MessageSeverity.Warning: // E_WARN (2) | a minor error occurred _P4Result.AddWarning(message.Format()); break; case P4MessageSeverity.Failed: // E_FAILED(3) | the command was used incorrectly _P4Result.AddError(message.Format()); break; case P4MessageSeverity.Fatal: // E_FATAL (4) | fatal error, the command can't be processed _P4Result.AddError(message.Format()); break; default: //TODO throw an error... unknown severity break; } }
internal void AddP4Message(P4Message message) { Messages.Add(message); }
public override void OutputMessage(P4Message message) { // if we get any message, it's an error?? }
/// <summary> /// Executed when a textual message is streamed from the server. /// </summary> /// <param name="message">The message.</param> public abstract void OutputMessage(P4Message message);