Skip to content

Commit e559652

Browse files
committed
Reorganized macro conditions for better readability
1 parent dcacb66 commit e559652

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/AsyncWebServerLogging.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33

44
#pragma once
55

6-
#ifdef ASYNCWEBSERVER_LOG_CUSTOM
6+
#if defined(ASYNCWEBSERVER_LOG_CUSTOM)
77
// The user must provide the following macros in AsyncWebServerLoggingCustom.h:
88
// async_ws_log_e, async_ws_log_w, async_ws_log_i, async_ws_log_d, async_ws_log_v
99
#include <AsyncWebServerLoggingCustom.h>
1010

11-
#elif defined(ASYNCWEBSERVER_LOG_DEBUG)
11+
#else // ASYNCWEBSERVER_LOG_CUSTOM
12+
13+
#if defined(ASYNCWEBSERVER_LOG_DEBUG)
1214
// Local Debug logging
1315
#include <HardwareSerial.h>
1416
#define async_ws_log_e(format, ...) Serial.printf("E async_ws %s() %d: " format "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__);
@@ -17,7 +19,8 @@
1719
#define async_ws_log_d(format, ...) Serial.printf("D async_ws %s() %d: " format "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__);
1820
#define async_ws_log_v(format, ...) Serial.printf("V async_ws %s() %d: " format "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__);
1921

20-
#else
22+
#else // ASYNCWEBSERVER_LOG_DEBUG
23+
2124
// Framework-based logging
2225

2326
/**
@@ -172,4 +175,5 @@
172175
#define async_ws_log_v(format, ...) ESP_LOGV("async_ws", "%s() %d: " format, __FUNCTION__, __LINE__, ##__VA_ARGS__)
173176
#endif // !LIBRETINY && !ARDUINO
174177

178+
#endif // ASYNCWEBSERVER_LOG_DEBUG
175179
#endif // ASYNCWEBSERVER_LOG_CUSTOM

0 commit comments

Comments
 (0)