JavaScript Functions > Alphabetical Listing of Utility Functions (lr) > lr.debugMessage


Sends a debug message to the log file.

ExampleMessage Functions


lr.debugMessage( message_level, message ); 


message_level One of the Message Log Run-Time Settings. Disabled does not apply.
message The message to be sent to the log file.

The lr.debugMessage function sends a debug message when the specified message level is active. If the specified message level is not active, a message is not issued. You can set the active message level to MSG_CLASS_BRIEF_LOG or MSG_CLASS_EXTENDED_LOG from the user interface or by using lr.setDebugMessage. To determine the current level, use lr.getDebugMessage.

Note that you can also specify multiple message levels with an OR separator ("|"). If any one of the levels are active, the message is issued to the Output window.

The message is sent to the output window. To display the debug messages in the output window, use the Expert mode Settings. Activate Expert mode (Tools > Expert mode) and then choose Tools > Options > Debug Information and select the General check box.

lr.setDebugMessage calls can affect the output.

Return Values

Returns the number of characters written, not including the terminating null-character if any. On error, returns a negative number.


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

Concept Link IconSee Also


function Action(){
   var rc = 2001;
   lr.setDebugMessage(lr.MSG_CLASS_EXTENDED_LOG, lr.SWITCH_ON);

   if (rc > 2000)

       lr.debugMessage(lr.MSG_CLASS_RESULT_DATA | lr.MSG_CLASS_PARAMETERS, "Operation failed.");
   return 0;