« Close

Datasheets and User Guides

App Notes

Software & Driver

 

LJM_DEBUG_LOG_FILE

Default

Windows Vista and later
C:\ProgramData\LabJack\LJM\ljm.log
Windows XP
C:\Documents and Settings\All Users\Application Data\LabJack\LJM\ljm.log
Mac OS X and Linux
/usr/local/share/LabJack/LJM/ljm.log

Summary

LJM_DEBUG_LOG_FILE is a string-based readable-writable LJM library configuration which sets the absolute or relative path of the file to output log messages to.

The constant LJM_DEBUG_LOG_FILE can be used interchangeably with the string "LJM_DEBUG_LOG_FILE".

Details

The configuration value of LJM_DEBUG_LOG_FILE is meaningless if LJM_DEBUG_LOG_MODE is in LJM_DEBUG_LOG_MODE_NEVER (which is the default).

    Relevant Constants

    See these debug logger parameters, especially LJM_DEBUG_LOG_MODE.

    Relevant Functions

    To read LJM_DEBUG_LOG_FILE, use LJM_ReadLibraryConfigStringS.

    To write LJM_DEBUG_LOG_FILE, use LJM_WriteLibraryConfigStringS or LJM_LoadConfigurationFile.

    For more information, see 2.7 Debugging Functions.

    Example

    [C/C++] Set LJM to log to the log file "ljm_monday.log"

    char ErrorString[LJM_MAX_NAME_SIZE];
    char DebugLogFile[LJM_MAX_NAME_SIZE];
    int LJMError;
    
    printf("Setting LJM_DEBUG_LOG_MODE to LJM_DEBUG_LOG_MODE_CONTINUOUS\n");
    LJMError = LJM_WriteLibraryConfigS(LJM_DEBUG_LOG_MODE, LJM_DEBUG_LOG_MODE_CONTINUOUS);
    if (LJMError != 0) {
        LJM_ErrorToString(LJMError, ErrorString);
        printf("LJM_WriteLibraryConfigS error: %s\n", ErrorString);
    }
    
    printf("Setting LJM_DEBUG_LOG_FILE to ljm_monday.log\n");
    LJMError = LJM_WriteLibraryConfigStringS(LJM_DEBUG_LOG_FILE, "ljm_monday.log");
    if (LJMError != 0) {
        LJM_ErrorToString(LJMError, ErrorString);
        printf("LJM_WriteLibraryConfigStringS error: %s\n", ErrorString);
    }
    
    LJMError = LJM_ReadLibraryConfigStringS(LJM_DEBUG_LOG_FILE, DebugLogFile);
    if (LJMError != 0) {
        LJM_ErrorToString(LJMError, ErrorString);
        printf("LJM_ReadLibraryConfigStringS error: %s\n", ErrorString);
    }
    printf("LJM_DEBUG_LOG_FILE is now %s\n", DebugLogFile);

    Possible output:

    Setting LJM_DEBUG_LOG_MODE to LJM_DEBUG_LOG_MODE_CONTINUOUS
    Setting LJM_DEBUG_LOG_FILE to ljm_monday.log
    LJM_DEBUG_LOG_FILE is now ljm_monday.log

     

    For more LJM configurations, see Library Configuration Functions.