-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Cludge needed to enable both IDF & Arduino log-statements #6534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
To clarify the 2nd issue i wrote above with latest release, what really buged me was that Arduino-logs were * silently ignored* when i had set |
Hello @ankostis, I'm not really sure if we can help on this. Platformio officialy doesn't support version 2.0.0 and newest so not sure if we are able to make this compatible. @me-no-dev Can you please take a look on this? |
What about the undefined |
My apologies for asking here for support, but where can i find such information? |
Take a look on this issue which is pinned at the top of Arduino core Issue tracker #6044. You can find there related issue opened in PIO. |
In a recent comment to #6044 claims that platformio does support 2.0.3-RC1, i corroborate that,
|
Not officialy, there are just workarounds |
Board
ESP32 dev (but irrelevant)
Device Description
Freematics but HW is irrelevant
Hardware Configuration
HW is irrelevant
Version
latest master
IDE Name
PlatformIO
Operating System
Debian SID
Flash frequency
irrelevant
PSRAM enabled
no
Upload speed
irrelevant
Description
I want to enable logging-statements with
USE_ESP_IDF_LOG
build_flag for bothESP_LOGI(<tag>, format, ...)
), andlog_i(format, ....)
.I've tried both 2.0.2 & 2.0.3-RC1, and i manged to have both log-statements enabled
only under the latest version 2.0.3-RC1,
reporting an issue discovered rlated to #6351 and my trouble setting log-levels afterwards.
arduino-esp32-v2.0.2
Under v2.0.0, as soon as i enabled this in my
platformio.ini
:compilation broke due to errors in all
log_x()
function calls, eg:Didn't spent time digging further, tried the latest release.
arduino-esp32-v2.0.3-RC1
Under the latest release, i dealt with 2 problems in order to make
both log macro-groups work:
TAG
undefinedWith just
USE_ESP_IDF_LOG
build_flag the compilation started breakingdue to missing declarations of
TAG
(i figured due to TAG-defining code commented-out by #6351), eg:
I had to add this definition into my build_flags
-DTAG='"arduino-tag"'
,and then i got just ERROR-level logs, as expected (the default log-level).
HINT: I suggest more polite approach, to leave the default tag present before #6351 got merged,
and introduce something like a
DEFAULT_ARDUINO_LOG_TAG
to override it.CORE_DEBUG_LEVEL
does not enable arduino logsThen i wanted to change the log-level.
Unfortunately, IDF's logging instructions :
are not quite fit for platformio because simply defining build_flags for
CONFIG_LOG_DEFAULT_LEVEL
&CONFIG_LOG_MAXIMUM_LEVEL
don't work due tosdkconfig.h
overriding them.
I thought to experiment with
CORE_DEBUG_LEVEL
:which it affected IDF-LOG statements only, and got no arduino logs at all!
(see sample code & sample-outputs, below)
I didn't manage to find why it happened, and had no feedback that something was wrong*
but i worked around it by using
plain integers, e.g.:
I have no hint there, but i believe that
CORE_DEBUG_LEVEL
should continue workingwith
ARDUHAL_LOG_LEVEL_XXX
along withESP_LOG_XXX
constants(reason: the later works on runtime, so it's natural the developer to try these constants),
anyhow, please provide guidance in the docs how to configure log-level for both macro-calls
on compile time.
Note that run-time levels worked like charm for both macros, afterwards.
Sketch
OUTPUT without arduino logs:
OUTPUT with arduino logs:
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: