ExtensionUninstaller API Technical Documentation
Logging
When the API uninstalls an application it autmatically logs its actions to the ExtUninstallLogger object. This object holds a hierarchal list of logs. This allows a process to have sub processes and to track where they go.
For example, one of the root log items could be "READ: application preferences", which could have child logs like "REMOVE: Preference domain 'myapp'". To display these logs you can either use the internal log dialog, via the API's showLogDialog(true) method, or you could list them yourself.
When you read the logs manually, you'll get the root log items ( ExtUninstallLogger object and each of them have a "children" array which contain any child logs.
When using a custom #uninstallFunc function, you'll need to log your activities. Below is an example of logging the actions of reading a datasource and then removing some elements from it.
Initialize the function
Line 3:Creates a log item assuming success.
Line 5 - 7Your function read through local.rdf to get the elements you need to remove.
Line 9Creates a child log item for the remove action, assuming success.
Line 10 - 12Your code attempts to remove the datasource element.
Line 14 - 16On failure, it sets the status, errorCode and errorMsg properties of the child log item to reflect the error.
Line 18The child log item is added as a child to the main log item.
Line 22 - 24On overall failuer, it sets the status, errorCode and errorMsg properties of the main log item to reflect the error.
Line 26The main log item is added to the logger object.
