Open sandboxFocus

Class LoggingOptions

Represents the build-time options for logging records. This class is exposed by DefaultOptions and ExceptionOptions. The values of this class cannot be changed at run time because they influence the way PostSharp instruments the code.

Inheritance
LoggingOptions
Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics.dll
Syntax
[Serializer(typeof(LoggingOptions.Serializer))]
public class LoggingOptions
Remarks

Set these options in postsharp.config, with a LoggingOptions element under the DefaultOptions or ExceptionOptions element of a LoggingProfile. Rebuild the project after changing them. Options that only affect the formatting of the records, such as the delimiter or the indentation, are run-time options of the backend instead; see Options.

Constructors

Name Description
LoggingOptions()

Initializes a new instance of the LoggingOptions class.

LoggingOptions(PortableFormatterConstructorContext)

Properties

Name Description
IncludeGenericParameters

Not implemented.

IncludeParameterName

Gets or sets a value indicating whether the parameter names should be logged. The default value is false.

IncludeParameterType

Gets or sets a value indicating whether the parameter types should be logged. The default value is false.

IncludeParameterValue

Gets or sets a value indicating whether the parameter values should be logged. The default value is true.

IncludeReturnValue

Gets or sets a value indicating whether the return value should be logged. The default value is true.

IncludeThisValue

Gets or sets a value indicating whether the value of the this argument in an instance method should be logged. The default value is false.

Level

Gets or sets the LogLevel with which the record should be emitted. The default value is Debug.

Methods

Name Description
Clone()

Returns a clone of the current object.

Freeze()

Prevents the object from being modified.

Merge(LoggingOptions)

Merges the values of another LoggingOptions object into the current object. The values of the other object take precedence over the values of the current object.

See Also