-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Support runtime change log level to higher verbosity level (IDFGH-3599) #5542
Comments
This is already implemented, just naming is maybe confused to you. Remember that you have to rebuild all components when you change option in menuconfig, so it is so much easier to change 1 line in app_main rather than go to menuconfig, change option and recompile app. |
This is not what I'm asking for... see https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/log.html#_CPPv417esp_log_level_setPKc15esp_log_level_t |
When you set
You can, but this wont make any difference since those logs are not part of binary, because default log level excluded them. |
I'm aware about that.
The problem of having CONFIG_LOG_DEFAULT_LEVEL=ESP_LOG_INFO and |
Hi @AxelLin, Thanks for explaining the request. Agree this would be useful. There are some considerations in implementing this, but I think we can probably find a way to make everything work smoothly. I'm afraid that I can't give you an ETA on this feature, but we will look into it. Angus |
hi @projectgus I though this could be quite easy:
So define CONFIG_LOG_MAX_LEVEL to make preprocessor check CONFIG_LOG_MAX_LEVEL instead of CONFIG_LOG_DEFAULT_LEVEL, then it should work. |
Hi @projectgus |
@AxelLin Thanks for being patient, this does look like it's relatively small amount of work but we're also pretty busy around here. :). The good news is that I have an implementation of this working, and it's currently in internal review. There are some tradeoffs so we might decide it needs further work, but hopefully not too long before it's available. |
Thanks for being patient! This option is available here now: |
boot.log |
The problem:
Currently the esp-idf only supports run-time lower verbosity level.
So if build with CONFIG_LOG_DEFAULT_LEVEL to NONE, it's not possible to see any log by using esp_log_level_set.
i.e. the CONFIG_LOG_DEFAULT_LEVEL also means the maximum log level.
However, this is a very common use case that people don't want to show any log messages in release firmware but would like to
enable log messages for debug when hitting issues.
In current esp-idf, the only resolution is to rebuild with a debug firmware with higher CONFIG_LOG_DEFAULT_LEVEL.
The suggestion:
Add CONFIG_LOG_MAX_LEVEL setting so people can decide it at compile-time and allow run-time set log level up to CONFIG_LOG_MAX_LEVEL.
This way, it should be ok to set CONFIG_LOG_DEFAULT_LEVEL=NONE for release firmware and then enable log messages for debug.
i.e. To allow runtime change log level to higher verbosity level for debug problem.
The text was updated successfully, but these errors were encountered: