|
81 | 81 |
|
82 | 82 | /** |
83 | 83 | * ESP8266 specific configurations |
| 84 | + * Note: __FUNCTION__ is stored in flash on ESP8266, so we use FPSTR() to handle it properly |
84 | 85 | */ |
85 | 86 | #elif defined(ESP8266) |
86 | 87 | #include <ets_sys.h> |
|
98 | 99 | #endif |
99 | 100 | // error |
100 | 101 | #if ASYNCWEBSERVER_LOG_LEVEL >= ASYNC_WS_LOG_ERROR |
101 | | -#define async_ws_log_e(format, ...) ets_printf(String(F("E async_ws %s() %d: " format)).c_str(), __FUNCTION__, __LINE__, ##__VA_ARGS__); |
| 102 | +#define async_ws_log_e(format, ...) Serial.printf_P(PSTR("E async_ws %d: " format "\n"), __LINE__, ##__VA_ARGS__) |
102 | 103 | #else |
103 | 104 | #define async_ws_log_e(format, ...) |
104 | 105 | #endif |
105 | 106 | // warn |
106 | 107 | #if ASYNCWEBSERVER_LOG_LEVEL >= ASYNC_WS_LOG_WARN |
107 | | -#define async_ws_log_w(format, ...) ets_printf(String(F("W async_ws %s() %d: " format)).c_str(), __FUNCTION__, __LINE__, ##__VA_ARGS__); |
| 108 | +#define async_ws_log_w(format, ...) Serial.printf_P(PSTR("W async_ws %d: " format "\n"), __LINE__, ##__VA_ARGS__) |
108 | 109 | #else |
109 | 110 | #define async_ws_log_w(format, ...) |
110 | 111 | #endif |
111 | 112 | // info |
112 | 113 | #if ASYNCWEBSERVER_LOG_LEVEL >= ASYNC_WS_LOG_INFO |
113 | | -#define async_ws_log_i(format, ...) ets_printf(String(F("I async_ws %s() %d: " format)).c_str(), __FUNCTION__, __LINE__, ##__VA_ARGS__); |
| 114 | +#define async_ws_log_i(format, ...) Serial.printf_P(PSTR("I async_ws %d: " format "\n"), __LINE__, ##__VA_ARGS__) |
114 | 115 | #else |
115 | 116 | #define async_ws_log_i(format, ...) |
116 | 117 | #endif |
117 | 118 | // debug |
118 | 119 | #if ASYNCWEBSERVER_LOG_LEVEL >= ASYNC_WS_LOG_DEBUG |
119 | | -#define async_ws_log_d(format, ...) ets_printf(String(F("D async_ws %s() %d: " format)).c_str(), __FUNCTION__, __LINE__, ##__VA_ARGS__); |
| 120 | +#define async_ws_log_d(format, ...) Serial.printf_P(PSTR("D async_ws %d: " format "\n"), __LINE__, ##__VA_ARGS__) |
120 | 121 | #else |
121 | 122 | #define async_ws_log_d(format, ...) |
122 | 123 | #endif |
123 | 124 | // verbose |
124 | 125 | #if ASYNCWEBSERVER_LOG_LEVEL >= ASYNC_WS_LOG_VERBOSE |
125 | | -#define async_ws_log_v(format, ...) ets_printf(String(F("V async_ws %s() %d: " format)).c_str(), __FUNCTION__, __LINE__, ##__VA_ARGS__); |
| 126 | +#define async_ws_log_v(format, ...) Serial.printf_P(PSTR("V async_ws %d: " format "\n"), __LINE__, ##__VA_ARGS__) |
126 | 127 | #else |
127 | 128 | #define async_ws_log_v(format, ...) |
128 | 129 | #endif |
|
0 commit comments