PostSharp6.5//API Reference/Post­Sharp.​Patterns.​Diagnostics.​Custom Namespace/Log­Level­Source Class

LogLevelSource Class

A facade to a LogSource constrained to a specific LogLevel. Instances of the LogLevelSource class are exposed as properties of the LogSource class, e.g. Debug or Error.
Inheritance Hierarchy
System.Object
  PostSharp.Patterns.Diagnostics.Custom.LogLevelSource

Namespace:  PostSharp.Patterns.Diagnostics.Custom
Assembly:  PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 6.5.8.0 (6.5.8.0)
Syntax
C#
public sealed class LogLevelSource

The LogLevelSource type exposes the following members.

Properties
  NameDescription
Public propertyEnabledOrNull
Returns the current LogLevelSource, or null if logging is not enabled for the current instance. This property allows to write conditional logging using the ?. operator.
Public propertyIsEnabled
Determines whether logging is enabled for the current Level.
Public propertyLevel
Gets the LogLevel to which the current LogLevelSource is constrained.
Methods
  NameDescription
Public methodLogActivity<TDescription>(TDescription, Action, OpenActivityOptions)
Executes an Action and logs its execution.
Public methodLogActivity<TDescription, TResult>(TDescription, Func<TResult>, OpenActivityOptions)
Executes a Func<TResult> and logs its execution.
Public methodLogActivityAsync<TDescription>(TDescription, Func<Task>, OpenActivityOptions)
Executes an asynchronous void delegate and logs its execution.
Public methodLogActivityAsync<TDescription, TResult>(TDescription, Func<Task<TResult>>, OpenActivityOptions)
Executes an asynchronous non-void delegate and logs its execution.
Public methodOpenActivity<T>
Opens an activity.
Public methodWrite<T>(T, WriteMessageOptions)
Writes a message.
Public methodWrite<T>(T, Exception, WriteMessageOptions)
Writes a message and specifies an Exception.
See Also