lr.get_debug_message

Returns the current message logging settings.

int lr.get_debug_message( ); 
Message FunctionsJava Syntax

The lr.get_debug_message function returns the current log runtime settings . The settings determine what information is sent output. The log settings are specified with the runtime settings dialog, or by using the lr.set_debug_message function.

The debug messages are sent to the output window or agent log file.

To evaluate the returned value, you can perform a bitwise AND operation. This allows you to determine which options are set. See the C version of the function, lr_get_debug_message.

Return Values

lr.get_debug_message returns runtime message settings for logging. The first table below shows the base values, one of which is always returned. The second table shows values that can be ORed with other values to refine the setting.

Log LevelC Language ConstantsObject Oriented ConstantsValue
Disabledlr.MSG_CLASS_DISABLE_LOGlr.MSG_CLASS_DISABLE_LOG0
Brieflr.MSG_CLASS_BRIEF_LOGlr.MSG_CLASS_BRIEF_LOG1
Extended Loglr.MSG_CLASS_EXTENDED_LOGlr.MSG_CLASS_EXTENDED_LOG16

The following are ORed with the Extended Log message setting used to further refine the setting.

Log LevelC Language ConstantsObject Oriented ConstantsValue
Result Datalr.MSG_CLASS_RESULT_DATAlr.MSG_CLASS_RESULT_DATA2
Parameter Substitutionlr.MSG_CLASS_PARAMETERSlr.MSG_CLASS_PARAMETERS4
Full Runtime Tracelr.MSG_CLASS_FULL_TRACElr.MSG_CLASS_FULL_TRACE8

Only on error.

Only on error can be ORed with all other message settings.
Which messages are sent on error depends on the other settings.

lr.MSG_CLASS_JIT_LOG_ON_ERRORlr.MSG_CLASS_JIT_LOG_ON_ERROR512

Parameterization

You cannot use standard parameterization for any arguments in this function.

Example

In the following example, the lr.get_debug_message function retrieves the runtime logging setting, performs bitwise comparisons with the settings constants, and outputs a message for two of the possible cases.

int msg_level;
int lvlMask = 0xF; //Filter out "Extended Log = 16"
int dataAndParams = (lr.MSG_CLASS_RESULT_DATA | lr.MSG_CLASS_PARAMETERS);
//Get the run time logging settings
msg_level = lr.get_debug_message( ); 
//Filter out "Extended Log"
msg_level &= lvlMask;
/* Check if message level is "Data Returned by Server" and "Parameter Substitution" */
if (msg_level == dataAndParams) 
    lr.message("Current message level is result data and parameters.");
/* Check for no extended logging */
if (msg_level == lr.MSG_CLASS_BRIEF_LOG) 
   lr.message("Current message level is Standard Log.");