Skip to content

Commit caaf62b

Browse files
committed
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 espressif/esp-idf#5637 Merges espressif/esp-idf#5638
1 parent ef32802 commit caaf62b

File tree

17 files changed

+27
-27
lines changed

17 files changed

+27
-27
lines changed

components/driver/adc_common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static const char *ADC_TAG = "ADC";
4444

4545
#define ADC_CHECK(a, str, ret_val) ({ \
4646
if (!(a)) { \
47-
ESP_LOGE(ADC_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \
47+
ESP_LOGE(ADC_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
4848
return (ret_val); \
4949
} \
5050
})
@@ -567,4 +567,4 @@ esp_err_t adc_vref_to_gpio(adc_unit_t adc_unit, gpio_num_t gpio)
567567
//Configure RTC gpio, Only ADC2's channels IO are supported to output reference voltage.
568568
adc_gpio_init(ADC_UNIT_2, ch);
569569
return ESP_OK;
570-
}
570+
}

components/driver/dac.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static const char *DAC_TAG = "DAC";
3030

3131
#define DAC_CHECK(a, str, ret_val) ({ \
3232
if (!(a)) { \
33-
ESP_LOGE(DAC_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \
33+
ESP_LOGE(DAC_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
3434
return (ret_val); \
3535
} \
3636
})
@@ -152,4 +152,4 @@ esp_err_t dac_cw_generator_config(dac_cw_config_t *cw)
152152
portEXIT_CRITICAL(&rtc_spinlock);
153153

154154
return ESP_OK;
155-
}
155+
}

components/driver/esp32/adc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static const char *ADC_TAG = "ADC";
5757

5858
#define ADC_CHECK(a, str, ret_val) ({ \
5959
if (!(a)) { \
60-
ESP_LOGE(ADC_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \
60+
ESP_LOGE(ADC_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
6161
return (ret_val); \
6262
} \
6363
})
@@ -161,4 +161,4 @@ int hall_sensor_read(void)
161161
adc1_config_channel_atten(ADC1_CHANNEL_0, ADC_ATTEN_DB_0);
162162
adc1_config_channel_atten(ADC1_CHANNEL_3, ADC_ATTEN_DB_0);
163163
return hall_sensor_get_value();
164-
}
164+
}

components/driver/esp32/touch_sensor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static SemaphoreHandle_t rtc_touch_mux = NULL;
5959
static const char *TOUCH_TAG = "TOUCH_SENSOR";
6060
#define TOUCH_CHECK(a, str, ret_val) ({ \
6161
if (!(a)) { \
62-
ESP_LOGE(TOUCH_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \
62+
ESP_LOGE(TOUCH_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
6363
return (ret_val); \
6464
} \
6565
})

components/driver/esp32s2/adc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static const char *ADC_TAG = "ADC";
4343

4444
#define ADC_CHECK(a, str, ret_val) ({ \
4545
if (!(a)) { \
46-
ESP_LOGE(ADC_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \
46+
ESP_LOGE(ADC_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
4747
return (ret_val); \
4848
} \
4949
})

components/driver/esp32s2/rtc_tempsensor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static const char *TAG = "tsens";
2929

3030
#define TSENS_CHECK(res, ret_val) ({ \
3131
if (!(res)) { \
32-
ESP_LOGE(TAG, "%s:%d (%s)", __FILE__, __LINE__, __FUNCTION__); \
32+
ESP_LOGE(TAG, "%s(%d)", __FUNCTION__, __LINE__); \
3333
return (ret_val); \
3434
} \
3535
})

components/driver/esp32s2/touch_sensor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
static const char *TOUCH_TAG = "TOUCH_SENSOR";
4646
#define TOUCH_CHECK(a, str, ret_val) ({ \
4747
if (!(a)) { \
48-
ESP_LOGE(TOUCH_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \
48+
ESP_LOGE(TOUCH_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
4949
return (ret_val); \
5050
} \
5151
})

components/driver/i2c.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535

3636
static const char *I2C_TAG = "i2c";
3737
#define I2C_CHECK(a, str, ret) if(!(a)) { \
38-
ESP_LOGE(I2C_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \
39-
return (ret); \
38+
ESP_LOGE(I2C_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
39+
return (ret); \
4040
}
4141

4242
/* DRAM_ATTR is required to avoid I2C array placed in flash, due to accessed from ISR */

components/driver/i2s.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
static const char* I2S_TAG = "I2S";
4444

4545
#define I2S_CHECK(a, str, ret) if (!(a)) { \
46-
ESP_LOGE(I2S_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \
46+
ESP_LOGE(I2S_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
4747
return (ret); \
4848
}
4949

components/driver/mcpwm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ typedef struct {
4242
static const char *MCPWM_TAG = "MCPWM";
4343

4444
#define MCPWM_CHECK(a, str, ret_val) if (!(a)) { \
45-
ESP_LOGE(MCPWM_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \
46-
return (ret_val); \
45+
ESP_LOGE(MCPWM_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
46+
return (ret_val); \
4747
}
4848

4949
#define MCPWM_DRIVER_INIT_ERROR "MCPWM DRIVER NOT INITIALIZED"

components/driver/rtc_io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ static const char *RTCIO_TAG = "RTCIO";
2525

2626
#define RTCIO_CHECK(a, str, ret_val) ({ \
2727
if (!(a)) { \
28-
ESP_LOGE(RTCIO_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \
28+
ESP_LOGE(RTCIO_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
2929
return (ret_val); \
3030
} \
3131
})

components/driver/sdio_slave.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ The driver of FIFOs works as below:
107107

108108
static const char TAG[] = "sdio_slave";
109109

110-
#define SDIO_SLAVE_LOGE(s, ...) ESP_LOGE(TAG, "%s:%d (%s):"s, __FILE__,__LINE__,__FUNCTION__,##__VA_ARGS__)
110+
#define SDIO_SLAVE_LOGE(s, ...) ESP_LOGE(TAG, "%s(%d): "s, __FUNCTION__,__LINE__,##__VA_ARGS__)
111111
#define SDIO_SLAVE_LOGW(s, ...) ESP_LOGW(TAG, "%s: "s, __FUNCTION__,##__VA_ARGS__)
112112

113113

@@ -746,4 +746,4 @@ uint8_t* sdio_slave_recv_get_buf(sdio_slave_buf_handle_t handle, size_t *len_o)
746746

747747
if (len_o!= NULL) *len_o= desc->hal_desc.length;
748748
return (uint8_t*)desc->hal_desc.buf;
749-
}
749+
}

components/driver/sigmadelta.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121

2222
static const char *TAG = "SIGMADELTA";
2323

24-
#define SIGMADELTA_CHECK(a,str,ret_val) if(!(a)) { \
25-
ESP_LOGE(TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \
26-
return (ret_val); \
24+
#define SIGMADELTA_CHECK(a,str,ret_val) if(!(a)) { \
25+
ESP_LOGE(TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
26+
return (ret_val); \
2727
}
2828

2929
typedef struct {

components/driver/touch_sensor_common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
static const char *TOUCH_TAG = "TOUCH_SENSOR";
3535
#define TOUCH_CHECK(a, str, ret_val) ({ \
3636
if (!(a)) { \
37-
ESP_LOGE(TOUCH_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \
37+
ESP_LOGE(TOUCH_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
3838
return (ret_val); \
3939
} \
4040
})
@@ -243,4 +243,4 @@ esp_err_t IRAM_ATTR touch_pad_clear_status(void)
243243
{
244244
touch_hal_clear_trigger_status_mask();
245245
return ESP_OK;
246-
}
246+
}

components/esp_http_client/lib/include/http_utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ int http_utils_str_starts_with(const char *str, const char *start);
8181

8282

8383
#define HTTP_MEM_CHECK(TAG, a, action) if (!(a)) { \
84-
ESP_LOGE(TAG,"%s:%d (%s): %s", __FILE__, __LINE__, __FUNCTION__, "Memory exhausted"); \
84+
ESP_LOGE(TAG,"%s(%d): %s", __FUNCTION__, __LINE__, "Memory exhausted"); \
8585
action; \
8686
}
8787

components/esp_websocket_client/esp_websocket_client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static const char *TAG = "WEBSOCKET_CLIENT";
4242
#define WEBSOCKET_PINGPONG_TIMEOUT_SEC (120)
4343

4444
#define ESP_WS_CLIENT_MEM_CHECK(TAG, a, action) if (!(a)) { \
45-
ESP_LOGE(TAG,"%s:%d (%s): %s", __FILE__, __LINE__, __FUNCTION__, "Memory exhausted"); \
45+
ESP_LOGE(TAG,"%s(%d): %s", __FUNCTION__, __LINE__, "Memory exhausted"); \
4646
action; \
4747
}
4848

components/tcp_transport/private_include/esp_transport_utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ extern "C" {
2525
*
2626
*/
2727
#define ESP_TRANSPORT_MEM_CHECK(TAG, a, action) if (!(a)) { \
28-
ESP_LOGE(TAG,"%s:%d (%s): %s", __FILE__, __LINE__, __FUNCTION__, "Memory exhausted"); \
28+
ESP_LOGE(TAG,"%s(%d): %s", __FUNCTION__, __LINE__, "Memory exhausted"); \
2929
action; \
3030
}
3131

@@ -46,4 +46,4 @@ struct timeval* esp_transport_utils_ms_to_timeval(int timeout_ms, struct timeval
4646
#ifdef __cplusplus
4747
}
4848
#endif
49-
#endif /* _ESP_TRANSPORT_UTILS_H_ */
49+
#endif /* _ESP_TRANSPORT_UTILS_H_ */

0 commit comments

Comments
 (0)