MetalamaAPI documentationFlashtrace APIFlashtraceFlashtrace­Level­Source
Open sandboxFocus

FlashtraceLevelSource Class

A facade to a FlashtraceSource constrained to a specific FlashtraceLevel. Instances of the FlashtraceLevelSource class are exposed as properties of the FlashtraceSource class, e.g. Debug or Error.

Inheritance
System.Object
FlashtraceLevelSource
Namespace: Flashtrace
Assembly: Flashtrace.dll
Syntax
public sealed class FlashtraceLevelSource : Object

Properties

Name Description
IfEnabled

Gets the current FlashtraceLevelSource, or null if logging is not enabled for the current instance. This property allows to write conditional logging using the ?. operator.

IsEnabled

Gets a value indicating whether logging is enabled for the current Level.

Level

Gets the FlashtraceLevel to which the current FlashtraceLevelSource is constrained.

Methods

Name Description
LogActivity<TDescription>(in TDescription, Action, in OpenActivityOptions)

Executes an System.Action and logs its execution.

LogActivity<TDescription>(in TDescription, Action, in OpenActivityOptions, in CallerInfo)
LogActivity<TDescription, TResult>(in TDescription, Func<TResult>, in OpenActivityOptions)

Executes a System.Func<> and logs its execution.

LogActivity<TDescription, TResult>(in TDescription, Func<TResult>, in OpenActivityOptions, in CallerInfo)
LogActivityAsync<TDescription>(in TDescription, Func<Task>, in OpenActivityOptions)

Executes an asynchronous void delegate and logs its execution.

LogActivityAsync<TDescription>(in TDescription, Func<Task>, in OpenActivityOptions, in CallerInfo)
LogActivityAsync<TDescription, TResult>(in TDescription, Func<Task<TResult>>, in OpenActivityOptions)

Executes an asynchronous non-void delegate and logs its execution.

LogActivityAsync<TDescription, TResult>(in TDescription, Func<Task<TResult>>, in OpenActivityOptions, in CallerInfo)
OpenActivity<T>(in T, in OpenActivityOptions)

Opens an activity that cannot be suspended (e.g. does not wait any await).

OpenActivity<T>(in T, in OpenActivityOptions, in CallerInfo)
OpenAsyncActivity<T>(in T, in OpenActivityOptions)

Opens an activity that contains an await.

OpenAsyncActivity<T>(in T, in OpenActivityOptions, in CallerInfo)
Write<T>(in T, in WriteMessageOptions)

Writes a message.

Write<T>(in T, in WriteMessageOptions, in CallerInfo)
Write<T>(in T, Exception, in WriteMessageOptions)

Writes a message and specifies an System.Exception.

Write<T>(in T, Exception, in WriteMessageOptions, in CallerInfo)