mirror of
https://github.com/Wessel/c-websocket-server.git
synced 2026-07-18 14:34:19 +02:00
feat: Populate repo
This commit is contained in:
25
include/macros.h
Normal file
25
include/macros.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef MACROS_H
|
||||
#define MACROS_H
|
||||
|
||||
enum DEBUG_STATE { INACTIVE, ACTIVE };
|
||||
|
||||
// const char* PREFIX_HEARTBEAT = "[\033[31mHRTB\033[0m]\t";
|
||||
// const char* PREFIX_DATABASE = "[\033[36mDTBS\033[0m]\t";
|
||||
// const char* PREFIX_GPIO = "[\033[35mGPIO\033[0m]\t";
|
||||
|
||||
#ifndef __DEBUG__
|
||||
#define __DEBUG__ ACTIVE
|
||||
#endif
|
||||
|
||||
/** @brief Prints to the console only if DEBUG = 1 **/
|
||||
#define dbg(fmt, ...) do { \
|
||||
if (__DEBUG__ == ACTIVE) \
|
||||
fprintf(stderr, "%s:%d:%s(): " fmt, __FILE__, __LINE__, __func__, __VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#define dbg_no_info(fmt, ...) do { \
|
||||
if (__DEBUG__ == ACTIVE) \
|
||||
fprintf(stderr, fmt, __VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user