Show / Hide Table of Contents

Class Trace

Facilitates debugging tasks enabled by TRACE conditional define

Inheritance
System.Object
Trace
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: NFX
Assembly: NFX.dll
Syntax
public static class Trace

Fields

TRACE

Declaration
public const string TRACE = "TRACE"
Field Value
Type Description
System.String

Methods

Assert(Boolean, String, DebugAction, String, MessageType, Int32, String, String, Nullable<Guid>, Int32)

Declaration
[Conditional("TRACE")]
public static void Assert(bool condition, string text = null, DebugAction action = DebugAction.Default, string from = null, MessageType type = MessageType.Trace, int source = 0, string topic = null, string pars = null, Guid? correlationContext = default (Guid? ), int frameOffset = 2)
Parameters
Type Name Description
System.Boolean condition
System.String text
DebugAction action
System.String from
MessageType type
System.Int32 source
System.String topic
System.String pars
System.Nullable<System.Guid> correlationContext
System.Int32 frameOffset

Fail(String, DebugAction, String, MessageType, Int32, String, String, Nullable<Guid>, Int32)

Declaration
[Conditional("TRACE")]
public static void Fail(string text = null, DebugAction action = DebugAction.Default, string from = null, MessageType type = MessageType.Debug, int source = 0, string topic = null, string pars = null, Guid? correlationContext = default (Guid? ), int frameOffset = 2)
Parameters
Type Name Description
System.String text
DebugAction action
System.String from
MessageType type
System.Int32 source
System.String topic
System.String pars
System.Nullable<System.Guid> correlationContext
System.Int32 frameOffset

Write(Func<String>, MessageType, Nullable<Guid>)

A simplified method for tracing that doesn't evaluate text generation function if tracing is disabled by configuration

Declaration
[Conditional("TRACE")]
public static void Write(Func<string> textFunc, MessageType type = MessageType.Trace, Guid? correlationContext = default (Guid? ))
Parameters
Type Name Description
System.Func<System.String> textFunc

Functor to evaluate to get the text sent to logger

MessageType type

Message type to log

System.Nullable<System.Guid> correlationContext

Optional correlation token to relate log entries

Write(String, String, MessageType, Int32, String, String, Nullable<Guid>, Int32)

Declaration
[Conditional("TRACE")]
public static void Write(string text, string from = null, MessageType type = MessageType.Trace, int source = 0, string topic = null, string pars = null, Guid? correlationContext = default (Guid? ), int frameOffset = 2)
Parameters
Type Name Description
System.String text
System.String from
MessageType type
System.Int32 source
System.String topic
System.String pars
System.Nullable<System.Guid> correlationContext
System.Int32 frameOffset

Write<TContext>(Func<TContext, String>, TContext, MessageType, Nullable<Guid>)

A simplified method for tracing that doesn't evaluate text generation function if tracing is disabled by configuration. It takes context argument that can be passed to the text-generating textFunc functor

Declaration
[Conditional("TRACE")]
public static void Write<TContext>(Func<TContext, string> textFunc, TContext ctx, MessageType type = MessageType.Trace, Guid? correlationContext = default (Guid? ))
Parameters
Type Name Description
System.Func<TContext, System.String> textFunc

Functor to evaluate to get the text sent to logger

TContext ctx

Context object

MessageType type

Message type to log

System.Nullable<System.Guid> correlationContext

Optional correlation token to relate log entries

Type Parameters
Name Description
TContext
Back to top Copyright © 2006-2018 Agnicore Inc
Generated by DocFX