psx emulator
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

22 lines
642 B

#ifndef PSXC_LOG_H_
#define PSXC_LOG_H_
#include <stdlib.h>
#define log(level, fmt, ...) \
_log(__FILE__, __func__, __LINE__, (level), fmt, ##__VA_ARGS__)
#define debug(fmt, ...) log("DEBUG", fmt, ##__VA_ARGS__)
#define fatal(fmt, ...) \
do { \
log("FATAL", fmt, ##__VA_ARGS__); \
exit(EXIT_FAILURE); \
} while (0)
#define info(fmt, ...) log("INFO", fmt, ##__VA_ARGS__)
extern void _log(const char *filename, const char *funcname, int line_num,
const char *lvl, const char *fmt, ...);
extern const char *REG_NAMES[32];
#endif