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

  1. #ifndef PSXC_LOG_H_
  2. #define PSXC_LOG_H_
  3. #include <stdlib.h>
  4. #define log(level, fmt, ...) \
  5. _log(__FILE__, __func__, __LINE__, (level), fmt, ##__VA_ARGS__)
  6. #define debug(fmt, ...) log("DEBUG", fmt, ##__VA_ARGS__)
  7. #define fatal(fmt, ...) \
  8. do { \
  9. log("FATAL", fmt, ##__VA_ARGS__); \
  10. exit(EXIT_FAILURE); \
  11. } while (0)
  12. #define info(fmt, ...) log("INFO", fmt, ##__VA_ARGS__)
  13. extern void _log(const char *filename, const char *funcname, int line_num,
  14. const char *lvl, const char *fmt, ...);
  15. extern const char *REG_NAMES[32];
  16. #endif