error()

The logLib.error() system function logs error messages to the console or a log file based on the logging framework configuration.

Syntax

logLib.error(message STRING in)
logLib.error(message STRING in, data ANY in)
message

Input can be any variable or expression that is assignment compatible with the STRING type.

data

Input can be any variable or expression that is assignment compatible with the ANY type.

Example

In the following example, the function logs error messages to the console or a log file based on the logging framework configuration.

logLib.error(“This is error text”)
loglib.error("data with error {}", data);

Compatibility

Table 1. Compatibility considerations for error()
Platform Issue
COBOL generation The error() function is not supported.