ConsoleCapture
Description
ConsoleCapture is a tool for displaying debug logs output from Autodesk® Revit® and other add-ins in real-time. It can be used to debug your add-ins. For more details, please refer to this page.
Tool Features
Search
You can search for keywords such as class names (Class Name) or messages (Message) using the search bar at the top of the panel.
Show/Hide
You can toggle the visibility of each column using the buttons in the side menu. Additionally, you can show/hide rows with CONSOLE or DEBUG types.
Copy
- Selective Copy: By selecting a row and pressing Ctrl + C, you can copy only the selected row.
- Bulk Copy: By clicking the copy button in the upper right corner of the panel, you can copy all rows at once.
Debug Log Output
There are mainly two methods to output debug logs: using the Console class or the Debug/Trace classes.
Console Class
The Console log is used when you need to display messages to standard output or standard error output as part of the program.
// Display message and add a newline
Console.WriteLine("ConsoleWriteLine"); // Output: ConsoleWriteLine
// Display message without a newline
Console.Write("Console"); Console.Write("Write"); // Output: ConsoleWrite
// Display error message and add a newline
Console.Error.WriteLine("Error message"); // Output: Error message
Trace Class
The Trace log is used for logs that may be output even in the production version of the application.
// Display message and add a newline
Trace.WriteLine("TraceWriteLine"); // Output: TraceWriteLine
// Display message without a newline
Trace.Write("Trace"); Trace.Write("Write"); // Output: TraceWrite
// Format and display message with a newline
Trace.TraceInformation("Trace.{0}", "Information"); // Output: Trace.Informatio
Debug Class
The Debug log is used for logs that are only needed during debugging. It is enabled in the debug build and disabled in the release build.
// Display message and add a newline
Debug.WriteLine("DebugWriteLine"); // Output: DebugWriteLine
// Display message without a newline
Debug.Write("Debug"); Debug.Write("Write"); // Output: DebugWrite
// Format and display message with a newline
Debug.Print("Debug.{0}", "Print"); // Output: Debug.Print