Print Page | Close Window

How To Use the IdeaBlade DebugLog and TraceViewer

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=982
Printed Date: 02-May-2025 at 7:40pm


Topic: How To Use the IdeaBlade DebugLog and TraceViewer
Posted By: HFloyd
Subject: How To Use the IdeaBlade DebugLog and TraceViewer
Date Posted: 03-Nov-2008 at 3:15pm
I just wanted to add this bit of info for newbies who might benefit from it.

If you'd like to be able to watch your application make calls to the database, etc. in real time and see where performance bottlenecks are occurring, set up your app to use the built-in IdeaBlade TraceViewer.


Add the TraceViewer to Your Program
 
It's incredibly easy to do.
  1. In your start-up project, add a reference to IdeaBlade.UI.WinForms.PlatformControls.
  2. Open your start-up class (typically Program.cs or Program.vb).
  3. Find the static Main method (Shared Main in VB).
  4. Make some room just below any calls to the Application class (e.g., Application.EnableVisualStyles()).
  5. Add the following code to show the TraceViewer.

// C#:
IdeaBlade.UI.WinForms.PlatformControls.TraceViewerForm traceForm
;
traceForm =
new IdeaBlade.UI.WinForms.PlatformControls.TraceViewerForm();
traceForm.Show();

' VB.NET:
Dim traceForm As _
  
New IdeaBlade.UI.WinForms.PlatformControls.TraceViewerForm()
traceForm.Show()

That is all there is to it. Next time you launch your application, the TraceViewer will appear, followed shortly thereafter by your application's main window. You can toggle between the two windows at will.

More info about the TraceViewer is here: http://www.ideablade.com/techtip_what_is_myDevForce_application_doing.htm - http://www.ideablade.com/techtip_what_is_myDevForce_application_doing.htm

To add your own messages to the TraceViewer's DebugLog.xml file,

1. Add "using IdeaBlade.Util;" to the file.

2. Write your debug statements like this:
    DebugFns.WriteLine("My debug Message");


-Heather



Print Page | Close Window