Co-authored-by: Zhuohan Li <zhuohan@openai.com> Co-authored-by: Maratyszcza <marat@openai.com> Co-authored-by: Volodymyr Kyrylov <vol@wilab.org.ua>
21 lines
497 B
C
21 lines
497 B
C
#pragma once
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
void gptoss_format_log(const char* format, va_list args);
|
|
|
|
__attribute__((__format__(__printf__, 1, 2)))
|
|
inline static void gptoss_log(const char* format, ...) {
|
|
va_list args;
|
|
va_start(args, format);
|
|
gptoss_format_log(format, args);
|
|
va_end(args);
|
|
}
|
|
|
|
#define GPTOSS_LOG_ERROR(message, ...) \
|
|
gptoss_log("Error: " message "\n", ##__VA_ARGS__)
|
|
|
|
#define GPTOSS_LOG_WARNING(message, ...) \
|
|
gptoss_log("Warning: " message "\n", ##__VA_ARGS__)
|