« Close

Datasheets and User Guides

App Notes

Software & Driver

 

LJM_DEBUG_LOG_LEVEL

Summary

LJM_DEBUG_LOG_LEVEL is a numerical readable-writable LJM library configuration with the following options:

  • LJM_STREAM_PACKET = 1
  • LJM_TRACE = 2
  • LJM_DEBUG = 4
  • LJM_INFO = 6
  • LJM_PACKET = 7
  • LJM_WARNING = 8
  • LJM_USER = 9
  • LJM_ERROR = 10
  • LJM_FATAL = 12

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

Details

LJM_DEBUG_LOG_MODE must allow for logging in order for LJM_DEBUG_LOG_LEVEL to have any effect.

LJM_DEBUG_LOG_LEVEL determines which log messages are output. LJM outputs the debug messages that are of the current LJM_DEBUG_LOG_LEVEL and greater.

Relevant Functions

To read LJM_DEBUG_LOG_LEVEL, use LJM_ReadLibraryConfigS.

To write LJM_DEBUG_LOG_LEVEL, use LJM_WriteLibraryConfigS or LJM_LoadConfigurationFile.

For more information, see 2.7 Debugging Functions.

Example

[C/C++] Read LJM_DEBUG_LOG_LEVEL then set LJM_DEBUG_LOG_LEVEL to LJM_WARNING

char ErrorString[LJM_MAX_NAME_SIZE];
double value;

int LJMError = LJM_ReadLibraryConfigS(LJM_DEBUG_LOG_LEVEL, &value);
if (LJMError != 0) {
    LJM_ErrorToString(LJMError, ErrorString);
    printf("LJM_ReadLibraryConfigS error: %s\n", ErrorString);
}
printf("The default for LJM_DEBUG_LOG_LEVEL is %.00f\n", value);

value = LJM_WARNING;
printf("Setting LJM_DEBUG_LOG_LEVEL to %.00f\n", value);
LJMError = LJM_WriteLibraryConfigS(LJM_DEBUG_LOG_LEVEL, value);
if (LJMError != 0) {
    LJM_ErrorToString(LJMError, ErrorString);
    printf("LJM_DEBUG_LOG_LEVEL error: %s\n", ErrorString);
}

Possible output:

The default for LJM_DEBUG_LOG_LEVEL is 7
Setting LJM_DEBUG_LOG_LEVEL to 8

 

For more LJM configurations, see Library Configuration Functions.