DebugLog()

#if defined(__cplusplus) && EI_C_LINKAGE == 1
extern "C" void DebugLog(const char* s);
#else
void DebugLog(const char* s);
#endif // defined(__cplusplus) && EI_C_LINKAGE == 1

Brief: Provide a way for strings to be output to some text stream

Location: edge-impulse-sdk/tensorflow/lite/micro/debug_log.h

Blocking: Depends on user implementation

Description:
DebugLog() is declared internally in the TensorFlow Lite library (in the Edge Impulse SDK), and the function must be defined by the user.

This function is used inside of the TensorFlow Lite for Microcontrollers (TFLM) library to print out debugging information during inference. In most cases, it can simply call ei_printf() as follows:

#if defined(__cplusplus) && EI_C_LINKAGE == 1
extern "C"
#endif
__attribute__((weak)) void DebugLog(const char* s) {
    ei_printf("%s", s);
}

Parameters:

  • s - [input] String (null-terminated character array) to be printed

Example:
The following examples demonstrate possible implementations of this function for various platforms. Note the __attribute__((weak)) in most of the definitions, which means that a user could override the implementation elsewhere in the program: