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.
Namespace: PostSharp.Patterns.Diagnostics.Custom
Assembly: PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 6.10.14.0 (6.10.14.0)
C#
public sealed class LogLevelSource
The LogLevelSource type exposes the following members.
Name | Description | |
---|---|---|
EnabledOrNull |
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.
| |
IsEnabled |
Determines whether logging is enabled for the current Level.
| |
Level |
Gets the LogLevel to which the current LogLevelSource is constrained.
|
Name | Description | |
---|---|---|
LogActivity<TDescription>(TDescription, Action, OpenActivityOptions) |
Executes an Action and logs its execution.
| |
LogActivity<TDescription, TResult>(TDescription, Func<TResult>, OpenActivityOptions) |
Executes a Func<TResult> and logs its execution.
| |
LogActivityAsync<TDescription>(TDescription, Func<Task>, OpenActivityOptions) |
Executes an asynchronous void delegate and logs its execution.
| |
LogActivityAsync<TDescription, TResult>(TDescription, Func<Task<TResult>>, OpenActivityOptions) |
Executes an asynchronous non-void delegate and logs its execution.
| |
OpenActivity<T> |
Opens an activity.
| |
Write<T>(T, WriteMessageOptions) |
Writes a message.
| |
Write<T>(T, Exception, WriteMessageOptions) |
Writes a message and specifies an Exception.
|