mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-08-24 02:40:00 +00:00
Nimble: Fix logging level mismatch
Added fix for two issues: 1. Fix C++ compilation issue due to automatic conversion between int and esp_error_level_t 2. Use correct level macros to use system wide logging scheme
This commit is contained in:
@@ -35,23 +35,23 @@
|
||||
|
||||
#ifdef ESP_PLATFORM
|
||||
#define MODLOG_ESP_LOCAL(level, ml_msg_, ...) do { \
|
||||
if (MYNEWT_VAL(BLE_HS_LOG_LVL) <= level) esp_log_write(level, "NimBLE", ml_msg_, ##__VA_ARGS__); \
|
||||
if (MYNEWT_VAL(BLE_HS_LOG_LVL) <= LOG_LOCAL_LEVEL) ESP_LOG_LEVEL_LOCAL(level, "NimBLE", ml_msg_, ##__VA_ARGS__); \
|
||||
} while(0)
|
||||
|
||||
#define MODLOG_DEBUG(ml_mod_, ml_msg_, ...) \
|
||||
MODLOG_ESP_LOCAL(LOG_LEVEL_DEBUG, ml_msg_, ##__VA_ARGS__)
|
||||
MODLOG_ESP_LOCAL(ESP_LOG_DEBUG, ml_msg_, ##__VA_ARGS__)
|
||||
|
||||
#define MODLOG_INFO(ml_mod_, ml_msg_, ...) \
|
||||
MODLOG_ESP_LOCAL(LOG_LEVEL_INFO, ml_msg_, ##__VA_ARGS__)
|
||||
MODLOG_ESP_LOCAL(ESP_LOG_INFO, ml_msg_, ##__VA_ARGS__)
|
||||
|
||||
#define MODLOG_WARN(ml_mod_, ml_msg_, ...) \
|
||||
MODLOG_ESP_LOCAL(LOG_LEVEL_WARN, ml_msg_, ##__VA_ARGS__)
|
||||
MODLOG_ESP_LOCAL(ESP_LOG_WARN, ml_msg_, ##__VA_ARGS__)
|
||||
|
||||
#define MODLOG_ERROR(ml_mod_, ml_msg_, ...) \
|
||||
MODLOG_ESP_LOCAL(LOG_LEVEL_ERROR, ml_msg_, ##__VA_ARGS__)
|
||||
MODLOG_ESP_LOCAL(ESP_LOG_ERROR, ml_msg_, ##__VA_ARGS__)
|
||||
|
||||
#define MODLOG_CRITICAL(ml_mod_, ml_msg_, ...) \
|
||||
MODLOG_ESP_LOCAL(LOG_LEVEL_CRITICAL, ml_msg_, ##__VA_ARGS__)
|
||||
MODLOG_ESP_LOCAL(ESP_LOG_ERROR, ml_msg_, ##__VA_ARGS__)
|
||||
|
||||
#else
|
||||
|
||||
|
||||
Reference in New Issue
Block a user