SW Task Event Loop Framework v1.0.0
High-performance C++ asynchronous event loop framework with timer management and promise-based programming
Loading...
Searching...
No Matches
Debug.h
Go to the documentation of this file.
1
9 #pragma once
10 #include <iostream>
11 #include <string>
12
13 // ========== DEBUG CONFIGURATION ==========
14
26 #ifndef TIMER_DEBUG_ENABLED
27 #define TIMER_DEBUG_ENABLED 0
28 #endif
29
41 #ifndef SLLOOPER_DEBUG_ENABLED
42 #define SLLOOPER_DEBUG_ENABLED 0
43 #endif
44
56 #ifndef EventQueue_DEBUG_ENABLED
57 #define EventQueue_DEBUG_ENABLED 0
58 #endif
59
60 // ========== TIMER MANAGER DEBUG MACROS ==========
61
77 #define TIMER_DEBUG(msg) \
78 do { \
79 if (TIMER_DEBUG_ENABLED) { \
80 std::cout << "[TimerManager] " << msg << std::endl; \
81 } \
82 } while(0)
83
99 #define TIMER_DEBUG_STREAM(stream_expr) \
100 do { \
101 if (TIMER_DEBUG_ENABLED) { \
102 std::cout << "[TimerManager] " << stream_expr << std::endl; \
103 } \
104 } while(0)
105
122 #define TIMER_ERROR(msg) \
123 std::cout << "[TimerManager ERROR] " << msg << std::endl
124
137 #define TIMER_ERROR_STREAM(stream_expr) \
138 std::cout << "[TimerManager ERROR] " << stream_expr << std::endl
139
156 #define TIMER_INFO(msg) \
157 std::cout << "[TimerManager] " << msg << std::endl
158
171 #define TIMER_INFO_STREAM(stream_expr) \
172 std::cout << "[TimerManager] " << stream_expr << std::endl
173
174 // ========== SLLOOPER DEBUG MACROS ==========
175
191 #define SLLOOPER_DEBUG(msg) \
192 do { \
193 if (SLLOOPER_DEBUG_ENABLED) { \
194 std::cout << "[SLLooper] " << msg << std::endl; \
195 } \
196 } while(0)
197
210 #define SLLOOPER_DEBUG_STREAM(stream_expr) \
211 do { \
212 if (SLLOOPER_DEBUG_ENABLED) { \
213 std::cout << "[SLLooper] " << stream_expr << std::endl; \
214 } \
215 } while(0)
216
230 #define SLLOOPER_ERROR(msg) \
231 std::cout << "[SLLooper ERROR] " << msg << std::endl
232
238 #define SLLOOPER_ERROR_STREAM(stream_expr) \
239 std::cout << "[SLLooper ERROR] " << stream_expr << std::endl
240
253 #define SLLOOPER_INFO(msg) \
254 std::cout << "[SLLooper] " << msg << std::endl
255
261 #define SLLOOPER_INFO_STREAM(stream_expr) \
262 std::cout << "[SLLooper] " << stream_expr << std::endl
263
264 // ========== EVENT QUEUE DEBUG MACROS ==========
265
281 #define EventQueue_DEBUG(msg) \
282 do { \
283 if (EventQueue_DEBUG_ENABLED) { \
284 std::cout << "[EventQueue] " << msg << std::endl; \
285 } \
286 } while(0)
287
300 #define EventQueue_DEBUG_STREAM(stream_expr) \
301 do { \
302 if (EventQueue_DEBUG_ENABLED) { \
303 std::cout << "[EventQueue] " << stream_expr << std::endl; \
304 } \
305 } while(0)
306
319 #define EventQueue_ERROR(msg) \
320 std::cout << "[EventQueue ERROR] " << msg << std::endl
321
327 #define EventQueue_ERROR_STREAM(stream_expr) \
328 std::cout << "[EventQueue ERROR] " << stream_expr << std::endl
329
342 #define EventQueue_INFO(msg) \
343 std::cout << "[EventQueue] " << msg << std::endl
344
354 #define EventQueue_INFO_STREAM(stream_expr) \
355 do { \
356 std::cout << "[EventQueue] " << stream_expr << std::endl; \
357 } while(0)
358