Show TOC Start of Content Area

Function documentation Message Output with Severity  Locate the document in its SAP Library structure

Use

      LocationfatalT, errorT, warningT, infoT, pathT, debugT

      CategoryfatalT, errorT, warningT, infoT

The names concerning the severity level of the messages generated by these methods are self-explanatory. The overloaded pattern is the same for each severity output. In the table below, the pattern is masked with ‘xxxx’:

Basic Methods

Location

Category

xxxxT(String message)

xxxxT(Location loc, String message)

xxxxT(String subloc, String message)

xxxxT(Location loc, String subloc, String message)

xxxxT(String message, Object[] args)

xxxxT(Location loc, String message, Object[] args)

xxxxT(String subloc, String message, Object[] args)

xxxxT(Location loc, String subloc, String message, Object[] args)

 

There is a pattern in the method overloading that revolves around the core argument – message. The addition of subloc and args offers flexibility for logging messages at the level of details that they need. Understanding these arguments can make it easier for you to select the heavily overloaded methods:

Arguments

Name

Description

loc

The only difference in the API between the location and the category is an additional loc argument in the category output methods. It is a typical request that log messages are always written with respect to a source code area. This proves to be very helpful for the logging analysis. By specifying the loc argument, you indicate that the message must be written as a trace message associated with the loc object. With a little configuration for the loc logging can be just done once, but will be piped for both message types (logs and traces) simultaneously.

Conversely, this works for a location as well, and the API can specify the category argument. For more information, see Relations Between Category and Location.

subloc

Treat the subloc argument as the method name of the source class from which the message is generated. This is optional, but with this argument included in the trace/log, the picture will be much clearer for your analysis. In particular, you can specify different arguments for overloaded methods.

message

The actual message to be printed is put in the argument message.

args

An array of additional arguments that are informative (dynamic information to be included in the message.) This is achieved by using the java.text.MessageFormat API to resolve arguments.

 

For more information about how to use the message output with severity, see:

·        Example of Working on a Location Object

·        Example of Working on a Category Object

End of Content Area