Click or drag to resize

Trace Class

Provides a set of methods and properties that help you trace the execution of your code.
Inheritance Hierarchy
SystemObject
  ABB.Robotics.DiagnosticsTrace

Namespace:  ABB.Robotics.Diagnostics
Assembly:  ABB.Robotics (in ABB.Robotics.dll) Version: 6.5.129.0
Syntax
C#
public abstract class Trace

The Trace type exposes the following members.

Constructors
  NameDescription
Protected methodTrace
Initializes a new instance of the Trace class
Top
Methods
  NameDescription
Public methodStatic memberCode exampleAssert(Boolean)
Checks for a condition and displays an assert message on the FlexPendant, containing a stack trace, if the condition is false. When the condition is false, the assert message, with a stack trace, is also sent out on the network. The message can be displayed in the controller console by enabling the functionality on the controller. Use fpcmd_enable_console_output to enable FlexPendant logging.
Public methodStatic memberCode exampleAssert(Boolean, String)
Checks for a condition and displays an assert message on the FlexPendant, containing a stack trace, if the condition is false. When the condition is false, the message, with a stack trace, is also sent out on the network. The message can be displayed in the controller console by enabling the functionality on the controller. Use fpcmd_enable_console_output to enable FlexPendant logging.
Public methodStatic memberCode exampleAssert(Boolean, String, String)
Checks for a condition and displays an assert message on the FlexPendant, with detailed information and a stack trace, if the condition is false. When the condition is false, the message, with detailed information and a stack trace, is also sent out on the network. The message can be displayed in the controller console by enabling the functionality on the controller. Use fpcmd_enable_console_output to enable FlexPendant logging.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodStatic memberCode exampleFail(String)
An error message, with a stack trace, is displayed on the FlexPendant. The error message, with a stack trace, is also sent out on the network. The error message can be displayed in the controller console by enabling the functionality on the controller. Use fpcmd_enable_console_output to enable FlexPendant logging.
Public methodStatic memberCode exampleFail(String, String)
An error message, with detailed error information and a stack trace, is displayed on the FlexPendant. The error message, with detailed error information and a stack trace, is also sent out on the network. The error message can be displayed in the controller console by enabling the functionality on the controller. Use fpcmd_enable_console_output to enable FlexPendant logging.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodStatic memberCode exampleWrite
A trace message is sent out on the network. The message can be displayed in the controller console by enabling the functionality on the controller. Use fpcmd_enable_console_output to enable FlexPendant logging.
Public methodStatic memberCode exampleWriteIf
Checks for a condition and sends a trace message out on the network if the condition is true. The message can be displayed in the controller console by enabling the functionality on the controller. Use fpcmd_enable_console_output to enable FlexPendant logging.
Public methodStatic memberCode exampleWriteLine
A trace message is sent out on the network. The message can be displayed in the controller console by enabling the functionality on the controller. Use fpcmd_enable_console_output to enable FlexPendant logging.
Public methodStatic memberCode exampleWriteLineIf
Checks for a condition and sends a trace message out on the network if the condition is true. The message can be displayed in the controller console by enabling the functionality on the controller. Use fpcmd_enable_console_output to enable FlexPendant logging.
Top
Remarks
You can use the properties and methods in the Trace class to instrument release builds. Instrumentation allows you to monitor the health of your application running in real-life settings. Tracing helps you isolate problems and fix them without disturbing a running system. Note: To enable debugging in C#, add the /d:TRACE flag to the compiler command line when you compile your code, or you can add #define TRACE to the top of your file. In Visual Basic, add the /d:TRACE=True flag to the compiler command line. In Visual Studio .NET projects, Trace is enabled by default. Therefore, code is generated for all Trace methods in both release and debug builds. This allows an end user to turn on tracing to help identify the problem without the program having to be recompiled. By contrast, Debug is disabled in release builds by default, so no executable code is generated for Debug methods. To disable Trace, see the Visual Studio .NET documentation.
Examples
This example displays and logs an error message.
Trace.Fail("Operation not allowed in current state", string.Format("state: {0}", myobj.State.ToString()));
See Also