lr.get_debug_message

Returns the current message logging settings.

JavaScript

function lr.get_debug_message( )

VBScript

Function lr.get_debug_message( )
Message Functions

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 log file.

To evaluate the returned value, you can perform a bitwise AND operation. This allows you to determine which options are set.

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 other tables show 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.   
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 can be ORed with all other message settings.
Which messages are sent on error depends on the other settings.
   
Only on error.LR_MSG_CLASS_JIT_LOG_ON_ERRORlr.MSG_CLASS_JIT_LOG_ON_ERROR512

Parameterization

Standard parameterization is not available for this function.

VBScript Example

The following example illustrates the use of the debug_message functions. The initial message level setting is lr.MSG_CLASS_BRIEF_LOG. After two calls to lr.set_debug_message, the setting is the ORed value of lr.MSG_CLASS_BRIEF_LOG, lr.MSG_CLASS_EXTENDED_LOG, and lr.MSG_CLASS_RESULT_DATA, which is 19.The values are retrieved for display with lr.get_debug_message. Then, lr.debug_message is called with several message level values to illustrate when there is output.

To help understand the example, refer to the table showing the decimal values of the message level constants and their bit masks.

Constant
Value
Mask
lr.MSG_CLASS_BRIEF_LOG
1
00001
lr.MSG_CLASS_EXTENDED_LOG
16
10000
lr.MSG_CLASS_PARAMETERS
4
00100
lr.MSG_CLASS_RESULT_DATA
2
00010
lr.MSG_CLASS_FULL_TRACE
8
01000
lr.MSG_CLASS_RESULT_DATA | lr.MSG_CLASS_FULL_TRACE
10
01010
lr.message "Initial Log level is " + CStr(lr.get_debug_message)


' Initial Log level is 1
lr.set_debug_message lr.MSG_CLASS_EXTENDED_LOG, 1
lr.message "Extended Log level is " + CStr(lr.get_debug_message)

' Extended Log level is 17
lr.set_debug_message lr.MSG_CLASS_EXTENDED_LOG Or lr.MSG_CLASS_RESULT_DATA , 1

lr.message "Extended with Results Log level is " + CStr(lr.get_debug_message)

'Extended with Results Log level is 19
' Call to any function or API 
' emulated with random number. 
' Return code over 2000 means the call failed.

Randomize
rc = Rnd * 4000
lr.message "Return code = " + Cstr(rc)
' Return code = 3713.669

if (rc>2000) then
lr.debug_message lr.MSG_CLASS_BRIEF_LOG , _
	"Operation failed with basic logging."

' Output: Operation failed with basic logging.

lr.debug_message lr.MSG_CLASS_EXTENDED_LOG, _
	"Operation failed with extended logging."

' Output: Operation failed with extended logging.

lr.debug_message lr.MSG_CLASS_PARAMETERS , _
	"Operation failed with parameter substitution logging."

' --- No output.

`lr.MSG_CLASS_PARAMETERS AND Current level:
` 00100 AND 10011 = 0

lr.debug_message lr.MSG_CLASS_RESULT_DATA , _
	"Operation failed with result data logging."

' Output: Operation failed with result data logging.

lr.debug_message lr.MSG_CLASS_FULL_TRACE , _
	"Operation failed with full trace logging."

' --- No output
`lr.MSG_CLASS_FULL_TRACE AND Current level:
`01000 AND 10011 = 0

lr.debug_message lr.MSG_CLASS_RESULT_DATA Or _
	 lr.MSG_CLASS_FULL_TRACE , _
	"Operation failed with either result data or full trace logging."

' Output: Operation failed with either result data or full trace logging.
` Full trace is not active, but Result data is, so this call outputs 
` the message
end if