refactor(log): use syslog

This commit is contained in:
2026-01-15 18:23:55 +01:00
parent d8f41b071d
commit 9c6d3f0bb3
8 changed files with 66 additions and 34 deletions

View File

@@ -21,18 +21,10 @@
#define _DEBUG "[DEBUG]"
#endif
#ifdef EVELOPER
#define CWS_LOG_DEBUG(msg, ...) fprintf(stdout, _DEBUG " [%s:%d] " msg "\n", __FILE__, __LINE__, ##__VA_ARGS__)
#else
#define CWS_LOG_DEBUG(msg, ...)
#endif
#define CWS_LOG_ERROR(msg, ...) fprintf(stderr, _ERR " [%s:%d] " msg "\n", __FILE__, __LINE__, ##__VA_ARGS__)
#define CWS_LOG_WARNING(msg, ...) fprintf(stdout, _WARNING " " msg "\n", ##__VA_ARGS__)
#define CWS_LOG_INFO(msg, ...) fprintf(stdout, _INFO " " msg "\n", ##__VA_ARGS__)
void cws_log_init(void);
void cws_log_info(const char *fmt, ...);
void cws_log_debug(const char *fmt, ...);
void cws_log_warning(const char *fmt, ...);
void cws_log_error(const char *fmt, ...);
void cws_log_shutdown(void);