PostSharpAPI ReferencePost­Sharp.​Patterns.​Diagnostics.​CustomLog­Event­Data
Open sandboxFocus

Class LogEventData

Specifies the properties of a log event (such as a message, an activity opening or an activity closing). Properties are typically passed in user code as an instance of an anonymous type. Any object can be provided. The properties of the message then stem from the properties of the CLR object. To change the logic that maps the CLR object to the list of property, you can specify a LogEventMetadata.

Inheritance
LogEventData
Implements
IEquatable<LogEventData>
Namespace: PostSharp.Patterns.Diagnostics.Custom
Assembly: PostSharp.Patterns.Common.dll
Syntax
public sealed class LogEventData : ValueType

Properties

Name Description
Data

Gets the raw CLR object. It must be interpreted using the Metadata property.

Metadata

Gets the LogEventMetadata, which exposes the Data as a visitable set of name-value properties.

Methods

Name Description
Create(Object)

Creates a new LogEventData and uses the default LogEventMetadata for the run-time type of the specified object.

Create(Object, LogEventMetadata)

Creates a new LogEventData and specifies a LogEventMetadata.

Create<T>(T)

Creates a new LogEventData and uses the default LogEventMetadata for the build-time type of the specified object. This overload is faster than the non-generic one.

Equals(LogEventData)

Indicates whether the current object is equal to another object of the same type.

Equals(Object)

Indicates whether this instance and a specified object are equal.

GetHashCode()

Returns the hash code for this instance.

ToDictionary()

Returns a dictionary containing all properties contained in the current LogEventData.

ToString()

Returns the fully qualified type name of this instance.

VisitProperties<TVisitorState>(ILoggingPropertyVisitor<TVisitorState>, ref TVisitorState, in LoggingPropertyVisitorOptions)

Invokes an action for each property in the current LogEventData.

WithAdditionalProperty<T>(String, T, in LoggingPropertyOptions)

Returns a LogEventData that augments the current one with an additional property, but does not change the expression model.

Operators

Name Description
Equality(LogEventData, LogEventData)

Determines whether two instances of the LogEventData type are equal.

Inequality(LogEventData, LogEventData)

Determines whether two instances of the LogEventData type are different.