PostSharp 6.8 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Diagnostics.​Record­Builders Namespace / Log­Record­Builder Class / Log­Record­Builder Methods

LogRecordBuilder Methods

The LogRecordBuilder type exposes the following members.

Methods
  NameDescription
Public methodBeginCustomRecord
Initializes the current LogRecordBuilder to emit a custom record.
Public methodBeginRecord
Initializes the current LogRecordBuilder to emit a standard (i.e. non-custom) record for a given context and method.
Public methodBeginWriteItem
Begins to build a specified item.
Public methodComplete
Emits the record and resets the current LogRecordBuilder. This method invoked after all SetThis<T>(T), SetParameter<T>(Int32, String, ParameterKind, String, T) and similar methods have been called.
Public methodDispose
Finishes the logging of the current record. Calling this method does not actually make the current LogRecordBuilder unusable, but it makes it usable for a next record in the same thread.
Protected methodEmitRecord
Emits the record. Invoked by the Complete() method.
Public methodEndWriteItem
Ends building a specified item.
Public methodForEachProperty(LoggingPropertyVisitor<Object>) Obsolete.
Invokes a delegate for each property defined in the current log record.
Public methodForEachProperty<T>(LoggingPropertyVisitor<T>, T)
Invokes a delegate for each property defined in the current log record.
Public methodGetOutputMultiplexEventData
Returns a list of properties that will be passed to the next backend in order if a multiplexer is used. See Remarks.
Protected methodReset
Resets all fields and properties of the current LogRecordBuilder to their initial value. Invoked by the Complete() method.
Public methodSetException
Sets the exception for the method or activity.
Public methodSetExecutionTime
Sets the method or activity execution time.
Public methodSetMethodGenericParameter<T>
Not implemented.
Public methodSetParameter<T>(Int32, String, ParameterKind, String, T)
Sets the value of a given parameter and uses the default formatter.
Public methodSetParameter<T>(Int32, String, ParameterKind, String, T, IFormatter<T>)
Sets the value of a given parameter and specifies the Formatter<T>.
Public methodSetReturnValue<T>(Int32, String, String, T)
Sets a given return value (there can be several return values in C# 7.0) and uses the default formatter.
Public methodSetReturnValue<T>(Int32, String, String, T, IFormatter<T>)
Sets a given return value (there can be several return values in C# 7.0) and uses a given formatter.
Public methodSetThis<T>(T)
Sets the this (instance) value and uses the default formatter. This method is only invoked if the IncludeThisValue property is true.
Public methodSetThis<T>(T, IFormatter<T>)
Sets the this (instance) value and uses a given formatter.
Public methodSetTypeGenericParameter<T>
Not implemented.
Public methodVisitProperties(Action<String, Object>, LoggingPropertyVisitorOptions)
Invokes a delegate each property on the current log record. This offers a simple way to visit properties, but it has a performance overhead compared to VisitProperties<TState>(ILoggingPropertyVisitor<TState>, TState, LoggingPropertyVisitorOptions) because it is weakly typed and cause the allocation of a closure class to build the action. It also does not expose the LoggingPropertyOptions.
Public methodVisitProperties<TState>(ILoggingPropertyVisitor<TState>, TState, LoggingPropertyVisitorOptions)
Invokes the Visit<TValue>(String, TValue, LoggingPropertyOptions, TState) method of an interface implementation for each property on the current record, but not in the context stack.
Public methodWriteCustomParameter<T>(Int32, ArraySegment<Char>, T)
Writes a custom parameter (passed as an ArraySegment<char>) and uses the default formatter.
Public methodWriteCustomParameter<T>(Int32, CharSpan, T, CustomLogParameterOptions)
Writes a custom parameter (passed as an CharSpan) and uses the default formatter.
Public methodWriteCustomParameter<T>(Int32, ArraySegment<Char>, T, IFormatter<T>)
Writes a custom parameter (passed as an ArraySegment<char>) and uses a given formatter.
Public methodWriteCustomParameter<T>(Int32, CharSpan, T, CustomLogParameterOptions, IFormatter<T>)
Writes a custom parameter (passed as an CharSpan) and uses a given formatter.
Public methodWriteCustomString(ArraySegment<Char>)
Write a custom string passed as an ArraySegment<char>.
Public methodWriteCustomString(CharSpan)
Write a custom string passed as an CharSpan.
See Also