Share this page

# lr.debug_message

Sends a debug message to the log file.

## C#

    void lr.debug_message( unsigned int message_level, string message );

## VB.NET

    Sub lr.debug_message( ByVal message_level As UInteger, ByVal message As String )

Message Functions

## Arguments

Name | Comments
--- | ---
message_level | One of the Message Log Runtime Settings. Disabled does not apply.
message | The message to be sent to the log file.

The lr.debug_message 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.set_debug_message. To determine the current level, use lr.get_debug_message.

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

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

## Return Values

No value returned.

## Parameterization

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

## Example

The following example issues the appropriate debug message when the login fails.

Copy code

    int status = login("username","password");
    if (status == lr.FAIL) {
      string strOutputMsg="Error: Unable to login to server";
      lr.debug_message(lr.MSG_CLASS_FULL_TRACE, strOutputMsg);
      lr.debug_message(lr.MSG_CLASS_EXTENDED_LOG, strOutputMsg);
    }

    public int login(string username, string password)
    {
    //emulate failed login
    return lr.FAIL;
    }

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: