#ifndef LOG_H_ #define LOG_H_ #include #include #include #define SE_LOG(str) se_log_with_tag(false, __FILE__, __LINE__, "LOG", (str)) #define SE_LOGF(fmt, ...) se_logf_with_tag(false, __FILE__, __LINE__, "LOG", (fmt), __VA_ARGS__) #define SE_LOG_ERROR(str) se_log_with_tag(true, __FILE__, __LINE__, "ERROR", (str)) #define SE_LOG_ERRORF(fmt, ...) se_logf_with_tag(true, __FILE__, __LINE__, "ERROR", (fmt), __VA_ARGS__) #define SE_LOG_FATAL(str) SE_LOG_ERROR(str); exit(-1) #define SE_LOG_FATALF(fmt, ...) SE_LOG_ERRORF(fmt, __VA_ARGS__); exit(-1) #define SE_LOG_FATAL_TODO(str) se_log_with_tag(true, __FILE__, __LINE__, "FATAL TODO", (str)); exit(-1) #define SE_LOG_FATAL_TODOF(fmt, ...) se_logf_with_tag(true, __FILE__, __LINE__, "FATAL TODO", (fmt), __VA_ARGS__); exit(-1) void se_log_out_set(FILE *log_out, FILE *log_err_out); void se_log_with_tag(const bool is_error, char* file_name, size_t line, const char* tag, char* str); void se_logf_with_tag(const bool is_error, char* file_name, size_t line, const char* tag, char* fmt, ...); #endif // LOG_H_