-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
esp32,esp8266: Fix ESP32 log levels, esp.osdebug() documentation #12900
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
esp32,esp8266: Fix ESP32 log levels, esp.osdebug() documentation #12900
Conversation
48fbabd
to
a6154ef
Compare
Thanks @projectgus , looks good! I had missed (when reporting #12815) that the docs were wrong for esp8266 also. Good fix! |
It might be one to look at breaking in MP 2.0, as it's really a different function on each of the ports: on esp8266 it's setting the destination UART for (We could also implement runtime redirecting of ESP-IDF logs to another UART, but it's probably not a hugely important feature either... and it would still be a different API on esp8266.) |
docs/library/esp.rst
Outdated
@@ -62,12 +62,18 @@ Functions | |||
|
|||
.. function:: flash_erase(sector_no) | |||
|
|||
.. function:: osdebug(level) | |||
.. function:: osdebug(uart_no, [level]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes below are not fully correct.
On esp8266 the behaviour for osdebug(uart_no)
is:
- pass
None
to disable debug logging - pass an integer UART number to enable logging on that UART
For esp32 it's osdebug(uart_no, level=LOG_DEBUG)
with:
uart_no
isNone
to disable logging- otherwise logging is enabled and the optional
level
specifies the level, with default LOG_LOCAL_LEVEL which I think is LOG_DEBUG (?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dpgeorge This also wasn't quite right, for a simple function it has a lot of complexities!
Have pushed a new commit which I've re-tested to double check behaviour matches docs..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
1c8ffb6
to
db75d76
Compare
At some point the config changed such that no messages above Error level were compiled into the final binary. Fixes issue micropython#12815. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
The behaviour described in the docs was not correct for either port. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
db75d76
to
a800ed5
Compare
esp.osdebug()
functionality, closes esp32: Can't change log level since IDF 5.0 update. #12815As part of the first fix, the ESP32 binary file unfortunately gets 20KB larger as it was being built without INFO level logging functions. The DEBUG and VERBOSE levels still aren't compiled in by default, enabling these requires a custom build with different
sdkconfig
(have added documentation for this).Binary sizes, ESP32_GENERIC board:
This work was funded through GitHub Sponsors.