driver, http_client, web_socket, tcp_transport: remove __FILE__ from log messages

__FILE__ macro in the error messages adds full paths to the production binarys, remove __FILE__ from the ESP_LOGE.

Closes https://github.com/espressif/esp-idf/issues/5637
Merges https://github.com/espressif/esp-idf/pull/5638
This commit is contained in:
Chen Yi Qun 2020-07-29 20:46:37 +08:00
parent ef3280295d
commit caaf62bdad
17 changed files with 27 additions and 27 deletions

View File

@ -44,7 +44,7 @@ static const char *ADC_TAG = "ADC";
#define ADC_CHECK(a, str, ret_val) ({ \ #define ADC_CHECK(a, str, ret_val) ({ \
if (!(a)) { \ if (!(a)) { \
ESP_LOGE(ADC_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \ ESP_LOGE(ADC_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
return (ret_val); \ return (ret_val); \
} \ } \
}) })

View File

@ -30,7 +30,7 @@ static const char *DAC_TAG = "DAC";
#define DAC_CHECK(a, str, ret_val) ({ \ #define DAC_CHECK(a, str, ret_val) ({ \
if (!(a)) { \ if (!(a)) { \
ESP_LOGE(DAC_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \ ESP_LOGE(DAC_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
return (ret_val); \ return (ret_val); \
} \ } \
}) })

View File

@ -57,7 +57,7 @@ static const char *ADC_TAG = "ADC";
#define ADC_CHECK(a, str, ret_val) ({ \ #define ADC_CHECK(a, str, ret_val) ({ \
if (!(a)) { \ if (!(a)) { \
ESP_LOGE(ADC_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \ ESP_LOGE(ADC_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
return (ret_val); \ return (ret_val); \
} \ } \
}) })

View File

@ -59,7 +59,7 @@ static SemaphoreHandle_t rtc_touch_mux = NULL;
static const char *TOUCH_TAG = "TOUCH_SENSOR"; static const char *TOUCH_TAG = "TOUCH_SENSOR";
#define TOUCH_CHECK(a, str, ret_val) ({ \ #define TOUCH_CHECK(a, str, ret_val) ({ \
if (!(a)) { \ if (!(a)) { \
ESP_LOGE(TOUCH_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \ ESP_LOGE(TOUCH_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
return (ret_val); \ return (ret_val); \
} \ } \
}) })

View File

@ -43,7 +43,7 @@ static const char *ADC_TAG = "ADC";
#define ADC_CHECK(a, str, ret_val) ({ \ #define ADC_CHECK(a, str, ret_val) ({ \
if (!(a)) { \ if (!(a)) { \
ESP_LOGE(ADC_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \ ESP_LOGE(ADC_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
return (ret_val); \ return (ret_val); \
} \ } \
}) })

View File

@ -29,7 +29,7 @@ static const char *TAG = "tsens";
#define TSENS_CHECK(res, ret_val) ({ \ #define TSENS_CHECK(res, ret_val) ({ \
if (!(res)) { \ if (!(res)) { \
ESP_LOGE(TAG, "%s:%d (%s)", __FILE__, __LINE__, __FUNCTION__); \ ESP_LOGE(TAG, "%s(%d)", __FUNCTION__, __LINE__); \
return (ret_val); \ return (ret_val); \
} \ } \
}) })

View File

@ -45,7 +45,7 @@
static const char *TOUCH_TAG = "TOUCH_SENSOR"; static const char *TOUCH_TAG = "TOUCH_SENSOR";
#define TOUCH_CHECK(a, str, ret_val) ({ \ #define TOUCH_CHECK(a, str, ret_val) ({ \
if (!(a)) { \ if (!(a)) { \
ESP_LOGE(TOUCH_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \ ESP_LOGE(TOUCH_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
return (ret_val); \ return (ret_val); \
} \ } \
}) })

View File

@ -35,7 +35,7 @@
static const char *I2C_TAG = "i2c"; static const char *I2C_TAG = "i2c";
#define I2C_CHECK(a, str, ret) if(!(a)) { \ #define I2C_CHECK(a, str, ret) if(!(a)) { \
ESP_LOGE(I2C_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \ ESP_LOGE(I2C_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
return (ret); \ return (ret); \
} }

View File

@ -43,7 +43,7 @@
static const char* I2S_TAG = "I2S"; static const char* I2S_TAG = "I2S";
#define I2S_CHECK(a, str, ret) if (!(a)) { \ #define I2S_CHECK(a, str, ret) if (!(a)) { \
ESP_LOGE(I2S_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \ ESP_LOGE(I2S_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
return (ret); \ return (ret); \
} }

View File

@ -42,7 +42,7 @@ typedef struct {
static const char *MCPWM_TAG = "MCPWM"; static const char *MCPWM_TAG = "MCPWM";
#define MCPWM_CHECK(a, str, ret_val) if (!(a)) { \ #define MCPWM_CHECK(a, str, ret_val) if (!(a)) { \
ESP_LOGE(MCPWM_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \ ESP_LOGE(MCPWM_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
return (ret_val); \ return (ret_val); \
} }

View File

@ -25,7 +25,7 @@ static const char *RTCIO_TAG = "RTCIO";
#define RTCIO_CHECK(a, str, ret_val) ({ \ #define RTCIO_CHECK(a, str, ret_val) ({ \
if (!(a)) { \ if (!(a)) { \
ESP_LOGE(RTCIO_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \ ESP_LOGE(RTCIO_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
return (ret_val); \ return (ret_val); \
} \ } \
}) })

View File

@ -107,7 +107,7 @@ The driver of FIFOs works as below:
static const char TAG[] = "sdio_slave"; static const char TAG[] = "sdio_slave";
#define SDIO_SLAVE_LOGE(s, ...) ESP_LOGE(TAG, "%s:%d (%s):"s, __FILE__,__LINE__,__FUNCTION__,##__VA_ARGS__) #define SDIO_SLAVE_LOGE(s, ...) ESP_LOGE(TAG, "%s(%d): "s, __FUNCTION__,__LINE__,##__VA_ARGS__)
#define SDIO_SLAVE_LOGW(s, ...) ESP_LOGW(TAG, "%s: "s, __FUNCTION__,##__VA_ARGS__) #define SDIO_SLAVE_LOGW(s, ...) ESP_LOGW(TAG, "%s: "s, __FUNCTION__,##__VA_ARGS__)

View File

@ -22,7 +22,7 @@
static const char *TAG = "SIGMADELTA"; static const char *TAG = "SIGMADELTA";
#define SIGMADELTA_CHECK(a,str,ret_val) if(!(a)) { \ #define SIGMADELTA_CHECK(a,str,ret_val) if(!(a)) { \
ESP_LOGE(TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \ ESP_LOGE(TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
return (ret_val); \ return (ret_val); \
} }

View File

@ -34,7 +34,7 @@
static const char *TOUCH_TAG = "TOUCH_SENSOR"; static const char *TOUCH_TAG = "TOUCH_SENSOR";
#define TOUCH_CHECK(a, str, ret_val) ({ \ #define TOUCH_CHECK(a, str, ret_val) ({ \
if (!(a)) { \ if (!(a)) { \
ESP_LOGE(TOUCH_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \ ESP_LOGE(TOUCH_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
return (ret_val); \ return (ret_val); \
} \ } \
}) })

View File

@ -81,7 +81,7 @@ int http_utils_str_starts_with(const char *str, const char *start);
#define HTTP_MEM_CHECK(TAG, a, action) if (!(a)) { \ #define HTTP_MEM_CHECK(TAG, a, action) if (!(a)) { \
ESP_LOGE(TAG,"%s:%d (%s): %s", __FILE__, __LINE__, __FUNCTION__, "Memory exhausted"); \ ESP_LOGE(TAG,"%s(%d): %s", __FUNCTION__, __LINE__, "Memory exhausted"); \
action; \ action; \
} }

View File

@ -42,7 +42,7 @@ static const char *TAG = "WEBSOCKET_CLIENT";
#define WEBSOCKET_PINGPONG_TIMEOUT_SEC (120) #define WEBSOCKET_PINGPONG_TIMEOUT_SEC (120)
#define ESP_WS_CLIENT_MEM_CHECK(TAG, a, action) if (!(a)) { \ #define ESP_WS_CLIENT_MEM_CHECK(TAG, a, action) if (!(a)) { \
ESP_LOGE(TAG,"%s:%d (%s): %s", __FILE__, __LINE__, __FUNCTION__, "Memory exhausted"); \ ESP_LOGE(TAG,"%s(%d): %s", __FUNCTION__, __LINE__, "Memory exhausted"); \
action; \ action; \
} }

View File

@ -25,7 +25,7 @@ extern "C" {
* *
*/ */
#define ESP_TRANSPORT_MEM_CHECK(TAG, a, action) if (!(a)) { \ #define ESP_TRANSPORT_MEM_CHECK(TAG, a, action) if (!(a)) { \
ESP_LOGE(TAG,"%s:%d (%s): %s", __FILE__, __LINE__, __FUNCTION__, "Memory exhausted"); \ ESP_LOGE(TAG,"%s(%d): %s", __FUNCTION__, __LINE__, "Memory exhausted"); \
action; \ action; \
} }