diff options
| author | Aargh Rai <aargh.rai+git@gmail.com> | 2026-07-10 16:01:57 +0530 |
|---|---|---|
| committer | Aargh Rai <aargh.rai+git@gmail.com> | 2026-07-10 16:01:57 +0530 |
| commit | a14da2fe3864712dab4e7c4cfb5c323026d668de (patch) | |
| tree | 418c8c8ff44a611cbe1c1269b10926527046e232 /src/logger/logger.h | |
| parent | 2761f8a533e2b025f209222a1e4ec70b91c7e8ee (diff) | |
moving header files to include directory & moving resources in it's own directory
i know currently there is race condition, but the code is getting too
messy, i will continue to this after i make a vis tool to analyse how i
should split up files & stuff
the code rn needs intense restructing for it to make any more progress
Diffstat (limited to 'src/logger/logger.h')
| -rw-r--r-- | src/logger/logger.h | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/src/logger/logger.h b/src/logger/logger.h deleted file mode 100644 index abcdb6d..0000000 --- a/src/logger/logger.h +++ /dev/null @@ -1,67 +0,0 @@ -#include <stdio.h> -#include <mqueue.h> - -#ifndef LOG_LEVEL - #define LOG_LEVEL 3 -#endif - -#ifndef HAS_LOG_MODULE -#ifndef LOG_MODULE - #define HAS_LOG_MODULE 0 - #define LOG_MODULE "" -#else - #define HAS_LOG_MODULE 1 -#endif -#endif - -#if LOG_LEVEL >= 3 -#define log_infof(...) do { \ - char log_buf[1024]; \ - int n = 1; \ - log_buf[0] = 'i'; \ - if (HAS_LOG_MODULE == 1) { \ - n = snprintf(log_buf + 1, 1023, "(%s) ", LOG_MODULE); \ - } \ - snprintf(log_buf + n, 1024 - n, __VA_ARGS__); \ - send_log(logging, log_buf, 1024); \ -} while(0); -#endif // LOG_LEVEL >= 3 - -#if LOG_LEVEL >= 2 -#define log_warnf(...) do { \ - char log_buf[1024]; \ - int n = 1; \ - log_buf[0] = 'w'; \ - if (HAS_LOG_MODULE == 1) { \ - n = snprintf(log_buf + 1, 1023, "(%s) ", LOG_MODULE); \ - } \ - snprintf(log_buf + n, 1024 - n, __VA_ARGS__); \ - send_log(logging, log_buf, 1024); \ -} while(0); -#endif // LOG_LEVEL >= 2 - -#if LOG_LEVEL >= 1 -#define log_errof(...) do { \ - char log_buf[1024]; \ - int n = 1; \ - log_buf[0] = 'e'; \ - if (HAS_LOG_MODULE == 1) { \ - n = snprintf(log_buf + 1, 1023, "(%s) ", LOG_MODULE); \ - } \ - snprintf(log_buf + n, 1024 - n, __VA_ARGS__); \ - send_log(logging, log_buf, 1024); \ -} while(0); -#endif // LOG_LEVEL >= 1 - - -#ifndef log_infof -#define log_infof(...) (void)0 -#endif -#ifndef log_warnf -#define log_warnf(...) (void)0 -#endif -#ifndef log_errof -#define log_errof(...) (void)0 -#endif - -void send_log(mqd_t target, const char* msg, int n); |
