Skip to content
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

Implement esp_log_level_get(TAG) (IDFGH-4770) #6573

Closed

Conversation

0xFEEDC0DE64
Copy link
Contributor

Add simple getter for current log level to skip expensive log construction.

example usage:

#include <string>
#include <esp_log.h>

extern std::string slowLogBuilder();

namespace {
constexpr const char TAG[] = "MAIN";
}

void someMethod()
{
    if (esp_log_level_get(TAG) >= ESP_LOG_DEBUG)
        ESP_LOGD(TAG, "current log status=%s", slowLogBuilder().c_str());
}
}

@0xFEEDC0DE64 0xFEEDC0DE64 changed the title Implemented esp_log_level_get(TAG) Implement esp_log_level_get(TAG) Feb 18, 2021
@github-actions github-actions bot changed the title Implement esp_log_level_get(TAG) Implement esp_log_level_get(TAG) (IDFGH-4770) Feb 18, 2021
@Alvin1Zhang
Copy link
Collaborator

Thanks for your contribution.

@0xFEEDC0DE64
Copy link
Contributor Author

Ok is this PR already in consideration? Are any questions open? Can I help somehow to get this merged?

@0xFEEDC0DE64
Copy link
Contributor Author

Ping?

@espressif-bot espressif-bot added Status: In Progress Work is in progress Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: In Progress Work is in progress labels Jun 7, 2021
alisitsyn pushed a commit to alisitsyn/esp-idf that referenced this pull request Jun 16, 2021
Removes duplicate code for a small runtime & size overhead if
esp_log_level_get() is not called in the firmware.

Follow-up to espressif#6573
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants