Up Test, log and debug code samples
DevForce Resource Center » Samples » Test, log and debug code samples » Code sample: Trace viewer (WPF)

Code sample: Trace viewer (WPF)

Last modified on September 20, 2012 11:16

You can use one of the DevForce trace viewers for a "real time" display of trace messages in your application.  In this sample we show how to use the WPF trace viewer.


Problem

By default DevForce writes its trace messages to a file, generally referred to as the debuglog.  The log file is a great tool for post-mortem analysis, but if you'd also like to see the trace messages as they happen, one of the DevForce-provided trace viewers can help.

Solution

The DevForce installation includes the WpfTraceViewer.exe utility in the Tools subfolder.  There's another trace viewer for Silverlight applications.

The sample shows a very simple WPF application, which displays the WPF Trace Viewer window at startup.  You'll see tracing messages displayed as the application initializes.

Then click the Load Data button on the main form to see the log entries written as a by-product of the data retrieval operation.

output_html_6ffb2371.png

Created by DevForce on July 14, 2010 16:40

This wiki is licensed under a Creative Commons 2.0 license. XWiki Enterprise 3.2 - Documentation. Copyright © 2020 IdeaBlade