Diagnostic tools: .Net Inspector and .Net Logger.

Classes

  ClassDescription
Public classInspector
A control that implements .Net Inspector tool for application debugging.
Public classInspectorForm
Top level form with .Net Inspector control.
Public classLogger
Thread-safe container that stores log messages
Public classLogMessage
Log message.
Public classLogMessageEventArgs
Information on log message.
Public classLogViewer
A thread-safe control to display log messages.

Enumerations

  EnumerationDescription
Public enumerationInspectingStyle
A style that specifies how will .Net Logger display extended information.
Public enumerationSeverity
Severity of a log message

Remarks

.Net Inspector is a powerful and thread-safe tool for applications debugging. It can be used to inspect business logic level of an application in real-time mode and to alter various application parameters. It's a common practice in software development to put break points in certain lines of code to view and alter values of certain variables in the IDE. When a developer inspects values through the IDE, the application is suspended. It is convenient for debugging simple applications. But if your application has lots of threads and timers, the debugging process becomes a really challenging task.

.Net Logger is a thread-safe system for storing and representation of various log messages. Besides text messages, programmer can associate with data any object that can carry extended information. For example, it can be a price snapshot, quantity value of a product or a pointer to the product object. When a programmer analyzes a log file, he can not just review messages, but also vizw product characteristics that can be dynamically changed. There are several possibilities of object association:

  • Creating a hierarchical representation of associated object's properties and its values
  • Displaying a list of properties with its values in a popup tooltip
  • Transferring an object associated with message to the .Net Inspector for detailed viewing and editing

 Copy imageCopy
public enum Way
{
    Buy,
    Sell,
}

public sealed class Quote
{
    private readonly long qty;
    private readonly decimal price;
    private readonly Way way;

    public Quote(long qty, decimal price, Way way)
    {
        this.qty = qty;
        this.price = price;
        this.way = way;
    }

    public long Qty
    {
        get { return qty; }
    }
    public decimal Price
    {
        get { return price; }
    }
    public Way Way
    {
        get { return way; }
    }
}

Logger.Info("Hey, I just got a new price", new Quote(31911, 41, Way.Buy));