Skip to content

esp32-hal-log.h macros not usable by default #893

@atanisoft

Description

@atanisoft

Hardware:

Board: ESP32 Dev Module
Core Installation/update date: 29/Nov/2017
IDE name: Platform.io
Flash Frequency: 40Mhz
Upload Speed: 115200

Description:

The macros defined in esp32-hal-log.h are not usable due to sdkconfig.h having CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL set to 0 (NONE). It would be good if this could be configured at project level.

Sketch:

//Change the code below by your sketch
#include <Arduino.h>
#include <esp32-hal-log.h>

void setup() {
  Serial.begin(115200L);
  log_e("test output - error");
  log_w("test output - warning");
  log_i("test output - info");
  log_d("test output - debug");
  log_v("test output - verbose");
}

void loop() {
}

In the above the "test output" lines will not be displayed on serial. The only solution I have found is modify sdkconfig.h to comment out the definition of CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL and pass this in via -DCONFIG_ARDUHAL_LOG_DEFAULT_LEVEL=XXXX in platformio.ini, very likely the Arduino IDE will behave similarly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions