Ultra Light Client Guide and Reference


Tracing inside the Smalltalk image

ULC includes a trace facility that prints messages to a configurable stream interface based on a system of aspects.

To direct output from the debugger from the System Transcript window, select ULC->Debug->Set Debugger To as follows:

If output is directed to WriteStream, you can display the contents of the stream in the System Transcript window.

ULC provides for user-defined aspects to be handled in the same routine. This feature can be used anywhere in your application code. Send the #ulcDebug:print: message to the UlcSystem default, with the first parameter being the aspect and the second one a block that evaluates to a string. If the aspect passed is selected, the result of the print block is appended to the current debug stream. The output is structured as follows:

ULC
<_ASPECT_String_Name_> <_Sending object printObject_String_> -> <_value of printBlock_>

The sending object is printed using UlcBaseApp->Object>>#printObject. This method in turn sends the #ulcPrintObjectOn: aStream message to the receiver. By default, that method prints the class name of the receiver, followed by the state of the receiver in brackets. The method printing the state (#ulcPrintStateOn: aStream) is typically reimplemented by classes and can be used by application classes as well.

If the aspect is set to nil, the #ulcDebug:print method of UlcSystem prints the block regardless of which aspects have been selected. This enables on-the-fly tracing during development.

This feature is not intended for packaged images, because it is not suppressible. In this case, you can extend the list of ULC aspects as follows:


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]