MetalamaAPI documentationFlashtrace APIFlashtraceFlashtrace­Source
Open sandboxFocus

FlashtraceSource Class

Allow to write log messages and trace the execution of activities.

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

Instances of this class are immutable.

You should typically have one instance of this class per type. Use Get() to get an instance of this class for the current type.

Properties

Name Description
Critical

Gets a FlashtraceLevelSource that can be used to write messages and open activities with the Critical severity.

CurrentContext

Abstraction of the Logging facility, through which other components emit their log records.

Debug

Gets a FlashtraceLevelSource that can be used to write messages and open activities with the Debug severity.

Default

Gets a FlashtraceLevelSource that can be used to write messages and open activities with the default severity of the current FlashtraceSource. The default severity is System.Diagnostics.Debug, unless it has been overwritten by the WithLevels(FlashtraceLevel, FlashtraceLevel) method.

Error

Gets a FlashtraceLevelSource that can be used to write messages and open activities with the Error severity.

Failure

Gets a FlashtraceLevelSource that can be used to write messages and open activities with the default failure severity of the current FlashtraceSource. The default severity is Error, unless it has been overwritten by the WithLevels(FlashtraceLevel, FlashtraceLevel) method.

Information

Gets a FlashtraceLevelSource that can be used to write messages and open activities with the Info severity.

None

Gets a FlashtraceLevelSource that can be used to write messages and open activities with the None severity. Such messages and activities are never displayed, but the activities can define properties that can be inherited to children activities and messages.

Null
Trace

Gets a FlashtraceLevelSource that can be used to write messages and open activities with the Trace severity.

Warning

Gets a FlashtraceLevelSource that can be used to write messages and open activities with the Warning severity.

Methods

Name Description
ApplyTransactionRequirements(ref OpenActivityOptions)

Evaluates whether a transaction needs to be open for a specified OpenActivityOptions and updates its TransactionRequirement property. This method must be invoked before calling OpenActivity<T>(in T, in OpenActivityOptions). It is not automatically called.

ForCurrentType()

Gets a new FlashtraceSource keeping all the configuration of the current instance, but for the calling type.

ForCurrentType(in CallerInfo)
ForSource(String)

Gets a new FlashtraceSource keeping all the configuration of the current instance, but for a source name.

ForType(Type)

Gets a new FlashtraceSource keeping all the configuration of the current instance, but for a different type.

Get()

Gets a FlashtraceSource for the calling type.

Get(in CallerInfo)
Get(String)

Gets a log source associated with a specific source name.

Get(String, FlashtraceRole)

Gets a log source for a specified role and source name.

Get(Type, FlashtraceRole)

Gets a log source for a specified role and System.Type.

IsEnabled(FlashtraceLevel)

Determines whether logging is enabled in the current FlashtraceSource for a given FlashtraceLevel.

WithLevel(FlashtraceLevel)

Exposes methods that allow to write messages and open activities with a specified FlashtraceLevel.

WithLevels(FlashtraceLevel, FlashtraceLevel)

Returns a new FlashtraceSource based on the current instance, but overrides the default logging levels.

WriteExecutionPoint()

Emits a log record with the source file and line of the caller.

WriteExecutionPoint(in CallerInfo)