ESP-IDF for Arduino Users, Tutorials Part 1: Logging

Serial.println(“begining”);

My notes

  • The logging macros are in “esp_log.h”
#include "esp_log.h"
  • Set the logging level in menuconfig.
$ idf.py menuconfig
  • Navigate to: Components -> Log Output -> Default log verbosity
  • Define a TAG, e.g.
static const char* TAG = “FruityModule”;
  • Call the log methods
ESP_LOGD(TAG, “I am a banana”);
  • Look, printf style is available too
ESP_LOGD(TAG, “I am a banana and I am %d years old”, age);
  • Multiple levels of the macros are available
ESP_LOGE — error (lowest)ESP_LOGW — warningESP_LOGI — infoESP_LOGD — debugESP_LOGV — verbose (highest)

Complete example

#include "esp_log.h"static const char* TAG = "main-main";void app_main(void)
{
ESP_LOGD(TAG, "begin");
}

--

--

--

Google Developer Platform. Advanced Trauma Life Support. Open Source. Abominator Class.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

PHP — P27: Ternary Operator

PHP Ternary Operator

Using virtual machines for testing software in a variety of complex environments

Watch a Recording of Our Webinar + Q&A on Designing a Conversational Chatbot Experience with…

Architecting Workflows For Reliability

The Ever Given stuck in the Suez canal

Notifications, the whole shebang IV

Using terraform module from a specific branch

WSO2 ENTERPRISE INTEGRATOR — Development with Java

FetchqCRON

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ali Afshar

Ali Afshar

Google Developer Platform. Advanced Trauma Life Support. Open Source. Abominator Class.

More from Medium

What is LazyBearZ ?

BDC Capital’s Cleantech Practice

Just start — the rest will fall in place

The Climate Optimist — 16 May ’22 — Fashion and Sustainability