logging
Methods
debug
debug(
pObject,pErrorID?,pDetails?,pShowDialog?,pFirstDetailAsMessage?):void
Logs an error and displays it, if desired. Works only if the debug mode has been enabled.
With an exception, it is fully logged, otherwise the value of toString is logged.
Parameters
anyThe error to be logged.
numberThe error ID.
anyThe error details, as a string array. This data will appear on a separate page of the message trace. The elements will be output line by line.
booleanIf 'true', a dialog will be displayed.
booleanIf 'true', the first detail from the error message (if available) will be displayed as a message.
Returns
voidExample
try {
var x = undefined;
question.showMessage(x.length);
} catch(err) {
logging.log("**************************");
logging.debug(err, logging.WARNING, [], true, true);
}
debugCustom
debugCustom(
pException,pModulID,pErrorId,pPriority,pMessage,pDetails,pShowDialog):void
Additional logging.
Logs an error and displays it, if desired. Works only if the debug mode has been enabled.
Parameters
anyThe error to be logged or 'null'.
numberThe module ID in the range from 71 to 89.
numberThe error ID in the range from 1 to 9999.
string | number | booleanThe priority from 'D' to 'Z' (descending priority).
string | number | booleanThe error message; 'null' for none.
anyThe details; 'null' for none.
boolean'true' shows a dialog for the error; 'false' does not.
Returns
voidExample
try {
var x = undefined;
question.showMessage(x.length);
} catch(err) {
logging.debugCustom(err, 85, 100, "Z", "Something went wrong here", null, true);
}
log
log(
pObject,pErrorID?,pDetails?):void
Logs a object.
Sends a message to all logging destinations (console, Telnet, file).
If a message (e.g. from an error) is logged, it will be treated as an object.
An exception, it is fully logged, otherwise, the value of toString is logged.
However, it is also possible to restrict the output to simple texts; these will be output as strings.
Parameters
anyThe error, e.g. if caught by Try-Catch.
numberThe ID that identifies this message. Can be defined using error constants: logging.ERROR (log level "M", logging.FATAL (log level "C"), logging.INFO (log level "Z"), logging.SEVERE (log level "D"), logging.WARNING (log level "R").
anyThe error details, as a string array. This data will appear on a separate page of the message trace. The elements will be output line by line.
Returns
voidExample
var webserviceBaseURL = vars.get("$global.tour.webserviceBaseURL");
pUrlStr = pUrlStr || "";
var webserviceUrl = webserviceBaseURL + pMethod + pUrlStr;
logging.debug("calling Tour Webservice by user '" + vars.getString("$sys.user") + "' ", logging.INFO, [
"pWebserviceURL:" + webserviceUrl
,"actionType:" + "POST"
,"dataTypeAccept:" + "application/json"
,"dataTypeSend:" + "application/json"
,"dataTypeJDITOAccept:" + util.DATA_TEXT
,"user:" + authData.user
], false);
logCustom
logCustom(
pException,pModulID,pErrorId,pPriority,pMessage,pDetails?,pShowDialog?):void
Additional logging.
Sends a message to all logging destinations (console, Telnet, file).
If a message (e.g. from an error) is logged, it will be treated as an object.
However, it is also possible to restrict the output to simple texts; these will be output as strings.
Parameters
anyThe error, e.g. if caught by Try-Catch, or 'null'.
numberThe module ID in the range from 71 to 89.
numberThe error ID in the range from 1 to 9999.
string | number | booleanThe priority from 'D' to 'Z' (descending priority).
string | number | booleanThe error message; 'null' for none.
anyThe details; 'null' for none.
boolean'true' shows a dialog for the error; 'false' does not.
Returns
voidExample
try {
var x = undefined;
question.showMessage(x.length);
} catch(err) {
logging.logCustom(err, 805, 100, "Z", "Something went wrong here", null, true);
}
show
show(
pObject,pErrorID?,pDetails?,pFirstDetailAsMessage?):void
Sends a message to all logging destinations (console, Telnet, file).
If a message (e.g. from an error) is logged, it will be treated as an object. With an exception, it is fully logged, Otherwise, the value of ToString is logged.
However, it is also possible to restrict the output to simple texts; these will be output as strings.
Parameters
anyAn element to be logged, e.g. an error message caught by Try-Catch.
numberThe ID that identifies this message.
anyError details, as a string array. This data will appear on a separate page of the message trace. The elements will be output line by line.
booleanIf 'true', the first detail from the error message, if available, will be displayed as a message.
Returns
voidExample
logging.show(ex, logging.INFO, [translate.text("Mail could not be transferred to the system.")], true);
showCustom
showCustom(
pException,pModulID,pErrorId,pPriority,pMessage,pDetails?):void
Advanced logging: Shows a dialog.
Sends a message to all logging destinations (console, Telnet, file).
If a message (e.g. from an error) is logged, it will be treated as an object.
However, it is also possible to restrict the output to simple texts; these will be output as strings.
Parameters
anyThe error , e.g. if caught by Try-Catch or 'null'.
numberThe module ID in the range from 71 to 89.
numberThe error ID in the range from 1 to 9999.
string | number | booleanThe priority from 'D' to 'Z' (descending priority).
string | number | booleanThe error message; 'null' for none.
anyThe details; 'null' for none.
Returns
voidtoLogString
toLogString(
pObject,pReadable?):string
Converts a log output into a readable log string, as it would have been written by logging.log().
Parameters
anyThe error to be logged.
boolean"true" logs the error like the console logger, including a corresponding message.
Returns
stringText of the log message ('null' in ADITO 4.3.16 and earlier versions, if it is no ADITO error).
Example
try {
var conditions = new Array();
conditions["COUNT"] = "1";
conditions["TYPE_1"] = calendar.VEVENT;
conditions["USER_BANANA"] = "Admin";
conditions["STATUS_1"] = "CONFIRMED";
var entries = calendars.getEntries(conditions);
}
catch(err)
{
logging.show(err);
question.showMessage(logging.toLogString(err, true));
}
Properties
ERROR
numberConstant for the errorID parameter of logging.log(): log level 'M'
FATAL
numberConstant for the errorID parameter of logging.log(): log level 'C'
INFO
numberConstant for the errorID parameter of logging.log(): log level 'Z'
SEVERE
numberConstant for the errorID parameter of logging.log(): log level 'D'
WARNING
numberConstant for the errorID parameter of logging.log(): log level 'R'