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

LogEventData Class

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)
Equals(Object)
GetHashCode()
ToDictionary()

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

ToString()
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.