« Close

Datasheets and User Guides

App Notes

Software & Driver

 

LJM_DEBUG_LOG_MODE

Summary

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

LJM_DEBUG_LOG_MODE_NEVER = 1

  • LJM will never log messages
  • The log thread will never start

LJM_DEBUG_LOG_MODE_CONTINUOUS = 2

  • LJM will log all messages with priority equal to or greater than the current LJM_DEBUG_LOG_LEVEL
  • The log thread will start when the first message with priority equal to or greater than the current LJM_DEBUG_LOG_LEVEL is scheduled to be output

LJM_DEBUG_LOG_MODE_ON_ERROR = 3

  • LJM will collect all messages with priority equal to or greater than the current LJM_DEBUG_LOG_LEVEL, but only output those messages if a log message with priority equal to or greater than LJM_ERROR (10) is scheduled to be output
  • The maximum number of messages that will be collected is LJM_DEBUG_LOG_BUFFER_MAX_SIZE
  • The log thread will start when the first message with priority equal to or greater than the current LJM_DEBUG_LOG_LEVEL is scheduled to be output

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

Relevant Functions

To read LJM_DEBUG_LOG_MODE, use LJM_ReadLibraryConfigS.

To write LJM_DEBUG_LOG_MODE, use LJM_WriteLibraryConfigS or LJM_LoadConfigurationFile.

For more information, see 2.7 Debugging Functions.

Example

[C/C++] Read LJM_DEBUG_LOG_MODE, set LJM_DEBUG_LOG_MODE, then read it again

char ErrorString[LJM_MAX_NAME_SIZE];
double Value = 0;
int LJMError = LJM_ReadLibraryConfigS(LJM_DEBUG_LOG_MODE, &Value);
if (LJMError != 0) {
    LJM_ErrorToString(LJMError, ErrorString);
    printf("LJM_ReadLibraryConfigS error: %s\n", ErrorString);
}
printf("The default for LJM_DEBUG_LOG_MODE is %.00f\n", Value);

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

LJMError = LJM_ReadLibraryConfigS(LJM_DEBUG_LOG_MODE, &Value);
if (LJMError != 0) {
    LJM_ErrorToString(LJMError, ErrorString);
    printf("LJM_ReadLibraryConfigS error: %s\n", ErrorString);
}
printf("LJM_DEBUG_LOG_MODE is now %.00f\n", Value);

Possible output:

The default for LJM_DEBUG_LOG_MODE is 1
Setting LJM_DEBUG_LOG_MODE to 2
LJM_DEBUG_LOG_MODE is now 2

For more LJM configurations, see Library Configuration Functions.