Skip to main content
Version: 2025.2

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

pObject
any

The error to be logged.

pErrorID?
number

The error ID.

pDetails?
any

The 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.

pShowDialog?
boolean

If 'true', a dialog will be displayed.

pFirstDetailAsMessage?
boolean

If 'true', the first detail from the error message (if available) will be displayed as a message.

Returns

void

Example

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

pException
any

The error to be logged or 'null'.

pModulID
number

The module ID in the range from 71 to 89.

pErrorId
number

The error ID in the range from 1 to 9999.

pPriority
string | number | boolean

The priority from 'D' to 'Z' (descending priority).

pMessage
string | number | boolean

The error message; 'null' for none.

pDetails
any

The details; 'null' for none.

pShowDialog
boolean

'true' shows a dialog for the error; 'false' does not.

Returns

void

Example

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

pObject
any

The error, e.g. if caught by Try-Catch.

pErrorID?
number

The 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").

pDetails?
any

The 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

void

Example

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

pException
any

The error, e.g. if caught by Try-Catch, or 'null'.

pModulID
number

The module ID in the range from 71 to 89.

pErrorId
number

The error ID in the range from 1 to 9999.

pPriority
string | number | boolean

The priority from 'D' to 'Z' (descending priority).

pMessage
string | number | boolean

The error message; 'null' for none.

pDetails?
any

The details; 'null' for none.

pShowDialog?
boolean

'true' shows a dialog for the error; 'false' does not.

Returns

void

Example

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

pObject
any

An element to be logged, e.g. an error message caught by Try-Catch.

pErrorID?
number

The ID that identifies this message.

pDetails?
any

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.

pFirstDetailAsMessage?
boolean

If 'true', the first detail from the error message, if available, will be displayed as a message.

Returns

void

Example

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

pException
any

The error , e.g. if caught by Try-Catch or 'null'.

pModulID
number

The module ID in the range from 71 to 89.

pErrorId
number

The error ID in the range from 1 to 9999.

pPriority
string | number | boolean

The priority from 'D' to 'Z' (descending priority).

pMessage
string | number | boolean

The error message; 'null' for none.

pDetails?
any

The details; 'null' for none.

Returns

void

toLogString

toLogString(pObject, pReadable?): string

Converts a log output into a readable log string, as it would have been written by logging.log().

Parameters

pObject
any

The error to be logged.

pReadable?
boolean

"true" logs the error like the console logger, including a corresponding message.

Returns

string

Text 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

number

Constant for the errorID parameter of logging.log(): log level 'M'


FATAL

number

Constant for the errorID parameter of logging.log(): log level 'C'


INFO

number

Constant for the errorID parameter of logging.log(): log level 'Z'


SEVERE

number

Constant for the errorID parameter of logging.log(): log level 'D'


WARNING

number

Constant for the errorID parameter of logging.log(): log level 'R'