Open sandboxFocus

Class LoggingVerbosityConfiguration

Manages the configuration of the minimum LogLevel for individual types and namespaces. This class is exposed by the Verbosity property. To create a new instance of this class, call CreateVerbosityConfiguration().

Inheritance
LoggingVerbosityConfiguration
Implements
Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics.dll
Syntax
public class LoggingVerbosityConfiguration : IDisposable
Remarks

This class is not meant to be derived because it is heavyweight and therefore the number of instances should be minimal. To store context-sensitive information, another mechanism should be used.

The DefaultVerbosity property gives the configuration of the default execution context. The default minimum level is Debug. Setting the level of a namespace overrides the levels of its child namespaces and types, so set the level of a parent namespace before the levels of its children.

To change the verbosity for a specific execution context only, for instance a web request, create an instance once with CreateVerbosityConfiguration(), store it, and call Use() when the request starts. Dispose the returned object when the request ends. Do not create an instance for each request.

Properties

Name Description
Backend

Gets the parent LoggingBackend.

IsDisposed

Gets a value indicating whether the current LoggingVerbosityConfiguration has already been disposed.

IsEnabled

Gets or sets a value indicating whether the current LoggingBackend is enabled. This property has precedence over, and does not affect, the minimum log levels set through the SetLevel(LogLevel) method.

IsReadOnly

Gets a value indicating whether the current instance is read-only. A LoggingVerbosityConfiguration is frozen when it starts being used by a LoggingContextLocalConfiguration.

Methods

Name Description
Dispose()
Dispose(bool)

Disposes the current object.

~LoggingVerbosityConfiguration()

Finalizes the current object.

Freeze()

Prevents further modifications in the current object.

FromXml(XElement)

Sets the verbosities in this instance according to data from an XML file.

Reset()

Resets all settings to their default value (that is, Debug level for everything).

SetMinimalLevel(LogLevel)

Sets the minimum LogLevel for all namespaces, types, and roles except system roles.

SetMinimalLevel(LogLevel, string)

Sets the minimum LogLevel for all namespaces and types for a specific role.

SetMinimalLevelForNamespace(LogLevel, string)

Sets the minimum LogLevel for a specific namespace and all roles except system roles.

SetMinimalLevelForNamespace(LogLevel, string, string)

Sets the minimum LogLevel for a specific namespace and role.

SetMinimalLevelForType(LogLevel, Type)

Sets the minimum LogLevel for a specific Type.

SetMinimalLevelForType(LogLevel, Type, string)

Sets the minimum LogLevel for a specific Type and role.

ToString()
Use()

Uses the current LoggingVerbosityConfiguration for the current execution context.

See Also