PostSharpAPI ReferencePost­Sharp.​Patterns.​DiagnosticsLogging­Type­Source
Open sandboxFocus

LoggingTypeSource Class

Allows to enable or disable logging for a specific type and exposes some information regarding the verbosity for this type. Note that a type here does not need to map to a .NET type. It can be an arbitrary dot-separated string.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics.dll
Syntax
public abstract class LoggingTypeSource : LoggingNamespaceSource, IContextLocalLogger, ILoggerExceptionHandler

Constructors

Name Description
LoggingTypeSource(LoggingNamespaceSource, String, Type)

Creates an instance of LoggingTypeSource.

LoggingTypeSource(LoggingNamespaceSource, Type)

Creates an instance of LoggingTypeSource.

Properties

Name Description
GenericParameterCount

Gets the number of generic parameters in the type.

Options

Gets the LoggingRoleConfiguration for the current role. This property is a shortcut to LoggingServices.Roles[this.Role].

SourceType

The type represented by the current LoggingTypeSource. This may be null if the log source is based on a name rather than on a type.

Methods

Name Description
Clone(String)

Returns a deep clone of the current object.

IsBackendEnabled(LogLevel)

Checks whether logging is enabled in the back-end for the given level.

IsEnabled(LogLevel)

Determines whether logging is enabled for the given LogLevel.

Refresh()

Refreshes the logging level from the back-end from the current node and all children nodes. The back-end-defined logging level is cached for performance reasons.

Explicit Interface Implementations

Name Description
IContextLocalLogger.GetRecordBuilder(in CustomLogRecordOptions, ref CallerInfo, ILoggingContext)
IContextLocalLogger.OpenActivity(in OpenActivityOptions, ref CallerInfo)
IContextLocalLogger.ResumeActivity(ILoggingContext, ref CallerInfo)
IContextLocalLogger.SetWaitDependency(ILoggingContext, Object)
IContextLocalLogger.SuspendActivity(ILoggingContext, ref CallerInfo)
ILoggerExceptionHandler.OnInternalException(Exception)
ILoggerExceptionHandler.OnInvalidUserCode(ref CallerInfo, String, Object[])