8 #include "freertos/FreeRTOS.h" 9 #include "freertos/task.h" 10 #include "esp_system.h" 11 #include "freertos/queue.h" 15 #define MESSAGE_QUEUE_SIZE CONFIG_MESSAGE_QUEUE_SIZE 16 #define BUFFER_SIZE CONFIG_BUFFER_SIZE 18 #define wifi_log_e(TAG, fmt, ...) generate_log_message(ESP_LOG_ERROR, TAG, __LINE__, __func__, fmt, __VA_ARGS__); 19 #define wifi_log_w(TAG, fmt, ...) generate_log_message(ESP_LOG_WARN, TAG, __LINE__, __func__, fmt, __VA_ARGS__); 20 #define wifi_log_i(TAG, fmt, ...) generate_log_message(ESP_LOG_INFO, TAG, __LINE__, __func__, fmt, __VA_ARGS__); 21 #define wifi_log_d(TAG, fmt, ...) generate_log_message(ESP_LOG_DEBUG, TAG, __LINE__, __func__, fmt, __VA_ARGS__); 22 #define wifi_log_v(TAG, fmt, ...) generate_log_message(ESP_LOG_VERBOSE, TAG, __LINE__, __func__, fmt, __VA_ARGS__); 28 void generate_log_message(esp_log_level_t level,
const char *TAG,
int line,
const char *func,
const char *fmt, ...);
QueueHandle_t wifi_logger_queue
Definition: wifi_logger.h:13
void start_wifi_logger(void)
wrapper function to start wifi logger
Definition: wifi_logger.c:179
int system_log_message_route(const char *fmt, va_list tag)
route log messages generated by ESP_LOGX to the wifi logger
Definition: wifi_logger.c:165
char * receive_from_queue(void)
Receive data from queue. Timeout is set to portMAX_DELAY, which is around 50 days (confirm from esp32...
Definition: wifi_logger.c:70
esp_err_t send_to_queue(char *log_message)
Sends log message to message queue.
Definition: wifi_logger.c:44
esp_err_t init_queue(void)
Initialises message queue.
Definition: wifi_logger.c:10
void init_wifi(void)
Initialises and connects to wifi.
Definition: wifi_logger.c:29
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
Definition: wifi_logger.c:112