PostSharp6.3/API Reference/Post­Sharp.​Patterns.​Diagnostics.​Record­Builders Namespace/Text­Log­Record­Builder Class

TextLogRecordBuilder Class

An implementation of LogRecordBuilder that builds text-based log records. This class is the base class for most back-ends.
Inheritance Hierarchy
System.Object
  PostSharp.Patterns.Diagnostics.RecordBuilders.LogRecordBuilder
    PostSharp.Patterns.Diagnostics.RecordBuilders.TextLogRecordBuilder
      More...

Namespace:  PostSharp.Patterns.Diagnostics.RecordBuilders
Assembly:  PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 6.3.11.0 (6.3.11.0)
Syntax
C#
public abstract class TextLogRecordBuilder : LogRecordBuilder

The TextLogRecordBuilder type exposes the following members.

Constructors
  NameDescription
Protected methodTextLogRecordBuilder
Initializes a new TextLogRecordBuilder.
Properties
  NameDescription
Public propertyBackend
Gets the parent back-end.
Public propertyBackendOptions
Shortcut for this.Backend.Options.
Protected propertyContext
Gets the LoggingContext to which the record belongs.
(Inherited from LogRecordBuilder.)
Protected propertyCustomRecordAttributes
Describes how the LogRecordBuilder will be used, when it is being used to build a custom message or a custom activity.
(Inherited from LogRecordBuilder.)
Public propertyException
Gets the Exception for the current record, or null if no exception is associated to the current record.
Public propertyIsDisposed
Determines whether the current instance has been disposed.
(Inherited from LogRecordBuilder.)
Protected propertyLevel
Gets the LogLevel for the current record.
Public propertyMemberName
Gets the name of the method, property or field for the current record.
Protected propertyOptions
Gets the LoggingOptions for the current record.
Protected propertyProfile
Gets the LoggingProfile for the current record.
Protected propertyRecordKind
Gets the kind of the current record (e.g. MethodEntry or MethodException).
(Inherited from LogRecordBuilder.)
Public propertySourceLineInfo
Gets the SourceLineInfo for the current record.
Public propertySourceType
Gets the source Type of the current record.
Protected propertyStringBuilder
Gets the current UnsafeStringBuilder where everything is being appended.
Public propertySyntheticId
Gets a cross-process globally unique identifier for the current LoggingContext. This value is created according to value of the LoggingBackend.Options.SyntheticIdFormatter property.
(Inherited from LogRecordBuilder.)
Protected propertyThreadContext
Gets the ThreadLoggingContext to which the current LogRecordBuilder belongs.
(Inherited from LogRecordBuilder.)
Protected propertyTypeSource
Gets the LoggingTypeSource for the current record.
Methods
  NameDescription
Protected methodAddHiddenCustomParameter<T>
Protected methodAppendAsyncInfo
Appends information about the async method to the current StringBuilder.
Protected methodAppendClosingParenthesisConditional
Appends a closing parenthesis to the current StringBuilder if required.
Protected methodAppendComma
Appends a command and a space to the current StringBuilder, and resets the required punctuation set by RequireComma() or RequirePunctuation(Char).
Protected methodAppendCommaConditional
Appends a comma to the current StringBuilder, unless this method is invoked for the first time for the current record.
Protected methodAppendContextDescription()
Appends the context Description (or the TypeSource name, if the type of the context is not equal to the source type of the record) to the current StringBuilder.
Protected methodAppendContextDescription(LoggingContext)
Appends the context Description to the current StringBuilder.
Protected methodAppendDelimiter
Appends a Delimiter to the current StringBuilder.
Protected methodAppendDelimiterConditional
Appends a Delimiter to the current StringBuilder if the RequireDelimiter() method has been called previously.
Protected methodAppendEpilogue
Appends the final part of log message to StringBuilder. This includes state machine number and execution time where relevant, but does not include exception details.
Protected methodAppendExceptionDetails
Appends exception details to StringBuilder if IncludeExceptionDetails is set.
Protected methodAppendExecutionTime
Appends the execution time to the current StringBuilder.
Protected methodAppendExecutionTimeThreshold
Appends the execution time threshold to the current StringBuilder.
Protected methodAppendIndentString
Appends indentation for the given to StringBuilder.
Protected methodAppendMemberName
Appends name of the member for the current record (including the declaring type name, subject to the IncludeType property) to the current StringBuilder, as well as an opening parenthesis.
Protected methodAppendOpeningParenthesis
Appends an opening parenthesis to the current StringBuilder.
Protected methodAppendProlog
Appends the indent string, context description, and the record kind to the current StringBuilder.
Protected methodAppendRecordKind
Appends the LogRecordKind of the current record to the current StringBuilder.
Protected methodAppendSemanticParameter(SemanticParameterKind, String, String, String, Int32)
Appends a parameter of String type to the current StringBuilder. Back-ends that support semantic logging may store the parameter value semantically instead of appending it to the StringBuilder.
Protected methodAppendSemanticParameter(SemanticParameterKind, String, Object, IFormatter, String, Int32)
Appends a parameter to the current StringBuilder, where the name is given as a String, and uses a specific formatter. Back-ends that support semantic logging may store the parameter value semantically instead of appending it to the StringBuilder. This method overload is weakly typed.
Protected methodAppendSemanticParameter<T>(SemanticParameterKind, ArraySegment<Char>, T, IFormatter<T>, String, Int32)
Appends a parameter to the current StringBuilder, where the name is given as a ArraySegment<T>, and uses a specific formatter. Back-ends that support semantic logging may store the parameter value semantically instead of appending it to the StringBuilder.
Protected methodAppendSemanticParameter<T>(SemanticParameterKind, String, T, IFormatter<T>, String, Int32)
Appends a parameter to the current StringBuilder, where the name is given as a String, and uses a specific formatter. Back-ends that support semantic logging may store the parameter value semantically instead of appending it to the StringBuilder. This method overload is strongly typed.
Protected methodAppendSourceLineInfo
Appends source (file, line) information to the current StringBuilder.
Protected methodAppendSpaces
Appends a given number of spaces to the current StringBuilder.
Protected methodAppendSpecialChar
Appends a special Char (which may require escaping with specific back-ends) to the current StringBuilder.
Protected methodAppendTrailingPeriod
Appends a trailing period (.) to the current StringBuilder, respecting the AppendTrailingPeriod property.
Protected methodAppendTypeName
Appends the name of the TypeSource to the current StringBuilder.
Public methodBeginCustomRecord
Initializes the current LogRecordBuilder to emit a custom record.
(Overrides LogRecordBuilder.BeginCustomRecord(LoggingContext, CustomLogRecordInfo).)
Public methodBeginRecord
Initializes the current LogRecordBuilder to emit a standard (i.e. non-custom) record for a given context and method.
(Overrides LogRecordBuilder.BeginRecord(LoggingContext, LogRecordInfo, LogMemberInfo).)
Public methodBeginWriteItem (Overrides LogRecordBuilder.BeginWriteItem(CustomLogRecordItem, CustomLogRecordTextOptions).)
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.
(Inherited from LogRecordBuilder.)
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.
(Overrides LogRecordBuilder.Dispose().)
Protected methodEmitRecord()
Emits the record. Invoked by the Complete() method.
(Overrides LogRecordBuilder.EmitRecord().)
Protected methodEmitRecord(Boolean)
Emits the record and specifies whether exception details should be appended to the text.
Protected methodEndContextDescription
Ends building the context Description and starts building the action text.
Protected methodEndContextDescriptionConditional
Switches between building the context Description and the action text. If the EndContextDescriptionConditional() method has been previously invoked, subsequent calls are ignored.
Public methodEndWriteItem
Ends building a specified item.
(Overrides LogRecordBuilder.EndWriteItem(CustomLogRecordItem).)
Public methodForEachProperty(LoggingPropertyVisitor<Object>)
Invokes a delegate for each property defined in the current log record.
(Inherited from LogRecordBuilder.)
Public methodForEachProperty<T>(LoggingPropertyVisitor<T>, T)
Invokes a delegate for each property defined in the current log record.
(Inherited from LogRecordBuilder.)
Protected methodGetContextDescription Obsolete.
Gets the context Description or the TypeSource name, if the type of the context is not equal to the source type of the record.
Protected methodGetContextDescriptionUnsafe Obsolete.
Gets an UnsafeString representing the context Description or the TypeSource name, if the type of the context is not equal to the source type of the record.
Protected methodGetContextForDescription Obsolete.
Gets the LoggingContext that should be used when getting or appending the Description.
Protected methodGetSourceName
Gets the name of the TypeSource for the current record, respecting the IncludeNamespace property.
Protected methodHasRecordKindName
Determines whether the AppendRecordKind() will append anything for the current record.
Protected methodMustBuildContextDescription
Determines whether the current Description should be appended to the current StringBuilder.
Protected methodRequireComma
Requires the next call to AppendCommaConditional() to append a comma even.
Protected methodRequireDelimiter
Causes the next call to the AppendDelimiterConditional() to append a Delimiter to the current StringBuilder.
Protected methodRequirePunctuation
Requires the next call to AppendCommaConditional() to append a specific punctuation character.
Protected methodReset
Resets all fields and properties of the current LogRecordBuilder to their initial value. Invoked by the Complete() method.
(Overrides LogRecordBuilder.Reset().)
Public methodSetException
Sets the exception for the method or activity.
(Overrides LogRecordBuilder.SetException(Exception).)
Public methodSetExecutionTime
Sets the method or activity execution time.
(Overrides LogRecordBuilder.SetExecutionTime(Double, Boolean).)
Public methodSetMethodGenericParameter<T>
Not implemented.
(Inherited from LogRecordBuilder.)
Public methodSetParameter<T>(Int32, String, ParameterKind, String, T)
Sets the value of a given parameter and uses the default formatter.
(Inherited from LogRecordBuilder.)
Public methodSetParameter<T>(Int32, String, ParameterKind, String, T, IFormatter<T>)
Sets the value of a given parameter and specifies the Formatter<T>.
(Inherited from LogRecordBuilder.)
Public methodSetParameter<T>(Int32, String, ParameterKind, String, T, IFormatter<T>)
Sets the value of a given parameter and specifies the Formatter<T>.
(Overrides LogRecordBuilder.SetParameter<T>(Int32, String, ParameterKind, String, T, IFormatter<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.
(Inherited from LogRecordBuilder.)
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.
(Inherited from LogRecordBuilder.)
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.
(Overrides LogRecordBuilder.SetReturnValue<T>(Int32, String, String, T, IFormatter<T>).)
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.
(Inherited from LogRecordBuilder.)
Public methodSetThis<T>(T, IFormatter<T>)
Sets the this (instance) value and uses a given formatter.
(Inherited from LogRecordBuilder.)
Public methodSetThis<T>(T, IFormatter<T>)
Sets the this (instance) value and uses a given formatter.
(Overrides LogRecordBuilder.SetThis<T>(T, IFormatter<T>).)
Public methodSetTypeGenericParameter<T>
Not implemented.
(Inherited from LogRecordBuilder.)
Protected methodShouldLogExceptionDetails
Determines whether exception details should be appended to the text of the current StringBuilder.
Public methodToString
Returns a string that represents the current object.
(Overrides Object.ToString().)
Protected methodWrite
Writes the final message to the back-end.
Public methodWriteCustomParameter<T>(Int32, ArraySegment<Char>, T)
Writes a custom parameter (passed as an ArraySegment<char>) and uses the default formatter.
(Inherited from LogRecordBuilder.)
Public methodWriteCustomParameter<T>(Int32, CharSpan, T, CustomLogParameterOptions)
Writes a custom parameter (passed as an CharSpan) and uses the default formatter.
(Inherited from LogRecordBuilder.)
Public methodWriteCustomParameter<T>(Int32, ArraySegment<Char>, T, IFormatter<T>)
Writes a custom parameter (passed as an ArraySegment<char>) and uses a given formatter.
(Inherited from LogRecordBuilder.)
Public methodWriteCustomParameter<T>(Int32, ArraySegment<Char>, T, IFormatter<T>)
Writes a custom parameter (passed as an ArraySegment<char>) and uses a given formatter.
(Overrides LogRecordBuilder.WriteCustomParameter<T>(Int32, ArraySegment<Char>, T, IFormatter<T>).)
Public methodWriteCustomParameter<T>(Int32, CharSpan, T, CustomLogParameterOptions, IFormatter<T>) (Inherited from LogRecordBuilder.)
Public methodWriteCustomParameter<T>(Int32, CharSpan, T, CustomLogParameterOptions, IFormatter<T>) (Overrides LogRecordBuilder.WriteCustomParameter<T>(Int32, CharSpan, T, CustomLogParameterOptions, IFormatter<T>).)
Public methodWriteCustomString(ArraySegment<Char>)
Write a custom string passed as an ArraySegment<char>.
(Overrides LogRecordBuilder.WriteCustomString(ArraySegment<Char>).)
Public methodWriteCustomString(CharSpan) (Overrides LogRecordBuilder.WriteCustomString(CharSpan).)
Protected methodWriteProperty
Appends the name and value of a property to the current StringBuilder.
See Also
Inheritance Hierarchy