7 #if (defined(_WIN32) || defined(_WIN64)) && !defined(__GNUC__)
8 #define MACRO_LOG_FUNC __FUNCTION__
10 #elif defined(__EMSCRIPTEN__)
11 #define MACRO_LOG_FUNC __func__
13 #define MACRO_LOG_FUNC __func__
27 #if RZ_CHECKS_LEVEL >= 2
28 #define RZ_DEFAULT_LOGLVL RZ_LOGLVL_WARN
30 #define RZ_DEFAULT_LOGLVL RZ_LOGLVL_ERROR
36 #define RZ_VLOG(lvl, tag, fmtstr, args) rz_vlog(MACRO_LOG_FUNC, __FILE__, \
37 __LINE__, lvl, tag, fmtstr, args);
39 #define RZ_LOG(lvl, tag, fmtstr, ...) rz_log(MACRO_LOG_FUNC, __FILE__, \
40 __LINE__, lvl, tag, fmtstr, ##__VA_ARGS__);
43 #define RZ_LOG_SILLY(fmtstr, ...) rz_log(MACRO_LOG_FUNC, __FILE__, \
44 __LINE__, RZ_LOGLVL_SILLY, NULL, fmtstr, ##__VA_ARGS__);
45 #define RZ_LOG_DEBUG(fmtstr, ...) rz_log(MACRO_LOG_FUNC, __FILE__, \
46 __LINE__, RZ_LOGLVL_DEBUG, NULL, fmtstr, ##__VA_ARGS__);
48 #define RZ_LOG_SILLY(fmtstr, ...)
49 #define RZ_LOG_DEBUG(fmtstr, ...)
52 #define RZ_LOG_VERBOSE(fmtstr, ...) rz_log(MACRO_LOG_FUNC, __FILE__, \
53 __LINE__, RZ_LOGLVL_VERBOSE, NULL, fmtstr, ##__VA_ARGS__);
54 #define RZ_LOG_INFO(fmtstr, ...) rz_log(MACRO_LOG_FUNC, __FILE__, \
55 __LINE__, RZ_LOGLVL_INFO, NULL, fmtstr, ##__VA_ARGS__);
56 #define RZ_LOG_WARN(fmtstr, ...) rz_log(MACRO_LOG_FUNC, __FILE__, \
57 __LINE__, RZ_LOGLVL_WARN, NULL, fmtstr, ##__VA_ARGS__);
58 #define RZ_LOG_ERROR(fmtstr, ...) rz_log(MACRO_LOG_FUNC, __FILE__, \
59 __LINE__, RZ_LOGLVL_ERROR, NULL, fmtstr, ##__VA_ARGS__);
60 #define RZ_LOG_FATAL(fmtstr, ...) rz_log(MACRO_LOG_FUNC, __FILE__, \
61 __LINE__, RZ_LOGLVL_FATAL, NULL, fmtstr, ##__VA_ARGS__);
RZ_API void rz_log_set_file(const char *filename)
RZ_API void rz_log_set_level(RzLogLevel level)
RZ_API void rz_log_set_traplevel(RzLogLevel level)
RZ_API void rz_log(const char *funcname, const char *filename, ut32 lineno, RzLogLevel level, const char *tag, const char *fmtstr,...) RZ_PRINTF_CHECK(6
enum rz_log_level RzLogLevel
RZ_API void rz_log_del_callback(RzLogCallback cbfunc)
Remove a logging callback.
RZ_API void RZ_API void rz_vlog(const char *funcname, const char *filename, ut32 lineno, RzLogLevel level, const char *tag, const char *fmtstr, va_list args)
RZ_API void rz_log_set_srcinfo(bool show_info)
RZ_API void rz_log_add_callback(RzLogCallback cbfunc)
Add a logging callback.
void(* RzLogCallback)(const char *output, const char *funcname, const char *filename, ut32 lineno, RzLogLevel level, const char *tag, const char *fmtstr,...) RZ_PRINTF_CHECK(7
RZ_API void rz_log_set_colors(bool show_colors)
#define RZ_PRINTF_CHECK(fmt, dots)