DiagramTrace

StockSharp.Xaml.Diagram.Diagnostics

An opt-in file trace of what the diagram does while the user works it.

Properties

FilePath
public static string FilePath { get; }
value = DiagramTrace.FilePath

The file being written, or while the trace is off.

IsEnabled
public static bool IsEnabled { get; private set; }
value = DiagramTrace.IsEnabled
DiagramTrace.IsEnabled = value

Whether anything is being written.

Methods

Enter
public static Scope Enter(string category, DiagramTraceMessage message)
result = DiagramTrace.Enter(category, message)

Marks a call that is expected to return, composing the line only when the trace is on.

category
Which part of the diagram is speaking.
message
What the call is doing, with the state it starts from.

Returns: A scope to dispose when the call returns.

Enter
public static Scope Enter(string category, string message)
result = DiagramTrace.Enter(category, message)

Marks a call that is expected to return, so a log without its exit names it.

category
Which part of the diagram is speaking.
message
What the call is doing, with the state it starts from.

Returns: A scope to dispose when the call returns.

OpenCall
public static string OpenCall(int threadId)
result = DiagramTrace.OpenCall(threadId)

The innermost call currently open on a thread, for a watchdog to name.

threadId
Managed thread identifier.

Returns: A description, or when nothing is open.

Start
public static string Start(string path)
result = DiagramTrace.Start(path)

Starts writing to a file, replacing whatever it held.

path
The file to write. When empty, one is placed next to the application.

Returns: The file being written.

Stop
public static void Stop()
DiagramTrace.Stop()

Stops writing and closes the file.

Write
public static void Write(string category, string message)
DiagramTrace.Write(category, message)

Writes one line.

category
Which part of the diagram is speaking.
message
What happened, carrying the state values that identify it.
Write
public static void Write(string category, DiagramTraceMessage message)
DiagramTrace.Write(category, message)

Writes one line, composing it only when the trace is on.

category
Which part of the diagram is speaking.
message
What happened, carrying the state values that identify it.
WriteThrottled
public static void WriteThrottled(string category, string key, DiagramTraceMessage message, TimeSpan interval)
DiagramTrace.WriteThrottled(category, key, message, interval)

Writes a rate limited line, composing it only when the trace is on.

category
Which part of the diagram is speaking.
key
What is being rate limited - one counter per key.
message
What happened.
interval
How often this key may be written.
WriteThrottled
public static void WriteThrottled(string category, string key, string message, TimeSpan interval)
DiagramTrace.WriteThrottled(category, key, message, interval)

Writes a line no more often than the given interval, counting what it left out.

category
Which part of the diagram is speaking.
key
What is being rate limited - one counter per key.
message
What happened.
interval
How often this key may be written.

Fields

DefaultFileName
public const string DefaultFileName
value = DiagramTrace.DefaultFileName

The file name used when the trace is turned on without one.

EnvironmentVariable
public const string EnvironmentVariable
value = DiagramTrace.EnvironmentVariable

The environment variable that turns the trace on for a host with no switch of its own.