WiFi Logger component  1.0
WiFi Logger component, uses wifi to output logs
WiFi Logger component

ESP32 WiFi logger - Log messages over WiFi, using either TCP, UDP or Websockets

Example App:

https://github.com/VedantParanjape/esp-component-examples/tree/master/esp_wifi_logger_example

Requirements

Installation

cd <your_esp_idf_project>
mkdir components
cd components
cp $IDF_PATH/examples/common_components/protocol_examples_common . -r
git clone https://github.com/VedantParanjape/esp-wifi-logger.git wifi_logger

Change CMakeList.txt to add the line given below:

set(EXTRA_COMPONENT_DIRS <relative_path_to_component_folder>)

component folder must contain protocol_examples_common and wifi_logger component

Usage

How to receive logs

### How to use in ESP-IDF Projects

wifi_log_e() - Generate log with log level ERROR
wifi_log_w() - Generate log with log level WARN
wifi_log_i() - Generate log with log level INFO
wifi_log_d() - Generate log with log level DEBUG
wifi_log_v() - Generate log with log level VERBOSE

IP Address of the server can be found out by running ifconfig on a linux machine

Configuration

idf.py menuconfig

Example

#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "wifi_logger.h"
void app_main(void)
{
start_wifi_logger(); // Start wifi logger
while(1)
{
wifi_log_e("test", "%s %d %f", "hello world wifi logger", 43, 45.341223242); // write log over wifi with log level -> ERROR
wifi_log_w("test", "%s %d %f", "hello world wifi logger", 43, 45.341223242); // write log over wifi with log level -> WARN
wifi_log_i("test", "%s %d %f", "hello world wifi logger", 43, 45.341223242); // write log over wifi with log level -> INFO
wifi_log_d("test", "%s %d %f", "hello world wifi logger", 43, 45.341223242); // write log over wifi with log level -> DEBUG
wifi_log_v("test", "%s %d %f", "hello world wifi logger", 43, 45.341223242); // write log over wifi with log level -> VERBOSE
vTaskDelay(100); // Wait for 100ms, prevent watchdog from triggering a reset
}
}

Detailed Documentation