warn()

The logLib.warn() system function captures warning messages and logs them to the console or a log file, depending on the configured logging framework.

Syntax

logLib.warn(message STRING in)
logLib.warn(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 warning messages to the console or a log file based on the logging framework configuration.

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

Compatibility

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