Class SimpleMessage
A plain IMessage with no anchor: severity, category, id, notification text and
optional detail. This is the default carrier for ad-hoc messages that have no other home.
When step context is available, a step-anchored decorator wraps a SimpleMessage
to add the StepIndex / SentenceCarrier without the producer needing to know it.
public class SimpleMessage : IMessage
- Inheritance
-
SimpleMessage
- Implements
- Inherited Members
- Extension Methods
Constructors
SimpleMessage(Severity, string, Category, string, object)
Initializes a new instance of the SimpleMessage class.
public SimpleMessage(Severity severity, string notification, Category category = Category.System, string id = null, object detail = null)
Parameters
severitySeverityImportance level.
notificationstringEnd-user friendly notification text.
categoryCategoryClassification; defaults to System.
idstringOptional structured id.
detailobjectOptional detail payload or exception.
Properties
Category
Gets the classification.
public Category Category { get; }
Property Value
Detail
Gets the optional detail payload or exception; null when not applicable.
public object Detail { get; }
Property Value
Id
Gets the structured id for filtering / suppression; may be null.
public string Id { get; }
Property Value
Notification
Gets the end-user friendly notification text.
public string Notification { get; }
Property Value
Severity
Gets the importance level.
public Severity Severity { get; }
Property Value
Methods
GetCategory()
Gets the classification — see Category.
public Category GetCategory()
Returns
- Category
The category of this message.
GetDetail()
Gets the optional detail payload or exception; null when not applicable.
public object GetDetail()
Returns
- object
The detail object, or null.
GetId()
Gets the structured id used for filtering / suppression; may be null.
public string GetId()
Returns
- string
The message id, or null when not applicable.
GetNotification()
Gets the end-user friendly notification text.
public string GetNotification()
Returns
- string
The notification text.
GetSeverity()
Gets the importance level — see Severity.
public Severity GetSeverity()
Returns
- Severity
The severity of this message.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.