Hello!
I am using the TI CC3235SF MCU (custom board) and the Azure IoT SDK C (C language) to connect my gateway to Azure IoTHub.
I have set the "logtrace" option to true to get the logs using LL SetOption function.
I print out my debug logs onto a serial monitor via UART using the following print function -
void debug(const char *format, ...)
{
char date[20];
va_list args;
va_start(args, format);
while (pthread_mutex_trylock(&printfMutex))
{
usleep(5000);
}
struct timespec tspec;
clock_gettime(CLOCK_REALTIME, &tspec);
unsigned int hrs = tspec.tv_sec / (60*60);
unsigned int min = (tspec.tv_sec - hrs6060) / 60;
unsigned int sec = (tspec.tv_sec - hrs6060 - min*60);
sprintf(date, "[%02d:%02d:%02d.%03d] ", hrs % 24, min, sec, tspec.tv_nsec / 1000000);
fprintf(stderr, "%s", date);
vfprintf(stderr, format, args);
va_end(args);
pthread_mutex_unlock(&printfMutex);
}
I want to see extensive Azure IoT SDK logs such as shown below-
How to enable such detailed logs? Do I need to do anything else other than setting the "logtrace" option to true?
-> 14:36:13 CONNECT | VER: 4 | KEEPALIVE: 240 | FLAGS: 192 | USERNAME: [...] | PWD: XXXX | CLEAN: 0
<- 14:36:13 CONNACK | SESSION_PRESENT: false | RETURN_CODE: 0x3