DiagramTrace
An opt-in file trace of what the diagram does while the user works it.
属性
public static string FilePath { get; }
value = DiagramTrace.FilePath
The file being written, or while the trace is off.
public static bool IsEnabled { get; private set; }
value = DiagramTrace.IsEnabled
DiagramTrace.IsEnabled = value
Whether anything is being written.
方法
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.
返回值: A scope to dispose when the call returns.
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.
返回值: A scope to dispose when the call returns.
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.
返回值: A description, or when nothing is open.
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.
返回值: The file being written.
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.
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.
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.
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.
字段
public const string DefaultFileName
value = DiagramTrace.DefaultFileName
The file name used when the trace is turned on without one.
public const string EnvironmentVariable
value = DiagramTrace.EnvironmentVariable
The environment variable that turns the trace on for a host with no switch of its own.