-
Notifications
You must be signed in to change notification settings - Fork 0
Data Containers
Data containers are used to attach additional data to log messages.
The API is shipped with a couple of useful data containers.
Classname | Description |
---|---|
/USI/CL_BAL_DC_COLLECTION | Wrapper for 0-n data containers. Can be passed to every method, that would accept a single data container. |
/USI/CL_BAL_DC_* | Name prefix for any data container shipped with this API. |
There are different groups of data containers:
Data Container Group | Description |
---|---|
Renderable containers | The contained data will be rendered using an instance of CL_GUI_CONTAINER. |
Navigation Containers | These containers do not render any output but just navigate somewhere (e.g. to source code positions). |
You can also attach data containers to your exceptions by adding a public attribute having one of the following types:
TYPE REF TO | Wraps | Description | Remarks |
---|---|---|---|
/USI/IF_EXCEPTION_DETAILS | Empty Interface | ||
/USI/IF_BAL_MESSAGE_DETAILS | /USI/IF_EXCEPTION_DETAILS | Empty Interface | |
/USI/IF_BAL_DATA_CONTAINER_COL | /USI/IF_BAL_MESSAGE_DETAILS | Data Container Collection | Not recommended - use one of the more generic types above. |
/USI/IF_BAL_DATA_CONTAINER | /USI/IF_BAL_MESSAGE_DETAILS | Single Data Container | Not recommended - use one of the more generic types above. |
When logging an exception the API will evaluate all public attributes of the exception object, that are object references. For each attribute a downcast to /USI/IF_BAL_DATA_CONTAINER and /USI/IF_BAL_DATA_CONTAINER_COL will be tried. If it succeeds the data containers attached to the exception will be added to the log message automatically.
The name of the attribute is completely arbitrary and multiple attributes are supported. It is recommended to use an attribute with a type that is generic enough to bind a single data container or a collection of data containers. This would make it very easy to attach virtually anything to the exception object.
If needed, additional data containers can be added, as described here.