A thread-safe control to display log messages.
Namespace: Dapfor.Net.DiagnosticsAssembly: Dapfor.Net (in Dapfor.Net.dll) Version: 2.10.3.24917 (2.10.3.24917)
Syntax
C# |
---|
public class LogViewer : UserControl |
Visual Basic |
---|
Public Class LogViewer Inherits UserControl |
Visual C++ |
---|
public ref class LogViewer : public UserControl |
F# |
---|
type LogViewer = class inherit UserControl end |
Remarks
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
Memory consumption of the LogViewer is about 150-160 bytes per message. The maximum quantity of the lines in the grid can be limited via MaxRowCount = MAX_VALUE. If the MAX_VALUE is exceeded, older messages are not displayed.
Besides that, memory consumption depends on size and type of object that can be stored together with the log entry. On the average, for simple objects this size equals 30-40 bytes per message. From the practical point of view, when the number of rows is limited to 100,000, memory consumption should not exceed 60-100 MB per 1,000,000 messages.
Examples
Copy | |
---|---|
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)); |
Inheritance Hierarchy
System..::..Object
System..::..MarshalByRefObject
System.ComponentModel..::..Component
System.Windows.Forms..::..Control
System.Windows.Forms..::..ScrollableControl
System.Windows.Forms..::..ContainerControl
System.Windows.Forms..::..UserControl
Dapfor.Net.Diagnostics..::..LogViewer
System..::..MarshalByRefObject
System.ComponentModel..::..Component
System.Windows.Forms..::..Control
System.Windows.Forms..::..ScrollableControl
System.Windows.Forms..::..ContainerControl
System.Windows.Forms..::..UserControl
Dapfor.Net.Diagnostics..::..LogViewer