WiFi Logger component  1.0
WiFi Logger component, uses wifi to output logs
Functions
wifi_logger.c File Reference
#include "wifi_logger.h"
Include dependency graph for wifi_logger.c:

Functions

esp_err_t init_queue (void)
 Initialises message queue. More...
 
void init_wifi (void)
 Initialises and connects to wifi. More...
 
esp_err_t send_to_queue (char *log_message)
 Sends log message to message queue. More...
 
char * receive_from_queue (void)
 Receive data from queue. Timeout is set to portMAX_DELAY, which is around 50 days (confirm from esp32 specs) More...
 
void generate_log_message (esp_log_level_t level, const char *TAG, int line, const char *func, const char *fmt,...)
 generates log message, of the format generated by ESP_LOG function More...
 
int system_log_message_route (const char *fmt, va_list tag)
 route log messages generated by ESP_LOGX to the wifi logger More...
 
void start_wifi_logger (void)
 wrapper function to start wifi logger More...
 

Function Documentation

◆ generate_log_message()

void generate_log_message ( esp_log_level_t  level,
const char *  TAG,
int  line,
const char *  func,
const char *  fmt,
  ... 
)

generates log message, of the format generated by ESP_LOG function

Parameters
levelset ESP LOG level {E, W, I, D, V}
TAGTag for the log message
lineline
funcfunc
fmtfmt

◆ init_queue()

esp_err_t init_queue ( void  )

Initialises message queue.

Returns
esp_err_t ESP_OK - if queue init sucessfully, ESP_FAIL - if queue init failed

◆ init_wifi()

void init_wifi ( void  )

Initialises and connects to wifi.

◆ receive_from_queue()

char* receive_from_queue ( void  )

Receive data from queue. Timeout is set to portMAX_DELAY, which is around 50 days (confirm from esp32 specs)

Returns
char* - returns log message received from the queue, returns NULL if error

◆ send_to_queue()

esp_err_t send_to_queue ( char *  log_message)

Sends log message to message queue.

Parameters
log_messagelog message to be sent to the queue
Returns
esp_err_t ESP_OK - if queue init sucessfully, ESP_FAIL - if queue init failed

◆ start_wifi_logger()

void start_wifi_logger ( void  )

wrapper function to start wifi logger

◆ system_log_message_route()

int system_log_message_route ( const char *  fmt,
va_list  tag 
)

route log messages generated by ESP_LOGX to the wifi logger

Parameters
fmtlogger string format
tagarguments
Returns
int return value of vprintf