Microsoft SDK for Java

Debug Class

Provides a set of utility functions for debugging code.

package com.ms.wfc.util

public class Debug

Remarks

By using methods in the Debug class to print debugging information and check your logic with assertions, you can make your code more robust without impacting your shipping product's performance.

Methods in the Debug class generally fall into four categories:

Methods that print debug information. These methods automatically compile out of your code if you don't have either DEBUG or TRACE conditional switches set.

Methods that return strings that contain useful debugging information. These methods are always available.

Methods that retrieve values of registry- or environment-configurable switches and are used to switch debug code in and out. These methods automatically compile out of your code or return false if you don't have a DEBUG conditional switch set.

Methods that display an assertion dialog box and compile out if the DEBUG conditional switch is not set.

By default, output is routed to the Output window within the Visual Studio Designer. If the application is launched from a command line, the output is directed to a console window. You can redirect the output from within Visual Studio by setting custom properties. The output directory can be specified in the Compile tab in the Project Properties dialog box.

You can redirect the output to a file using the /out command-line switch when running builds from the command line. By default, command-line errors are displayed in a message box.

See Also   Debugging Applications

© 1999 Microsoft Corporation. All rights reserved. Terms of use.