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.

21 lines
663 B

  1. #ifndef PSXC_LOG_H_
  2. #define PSXC_LOG_H_
  3. #include <stdlib.h>
  4. #define log(level, fmt, ...) _log(__FILE__, __func__, __LINE__, (level), fmt, ##__VA_ARGS__)
  5. #define debug(fmt, ...) log("DEBUG", fmt, ##__VA_ARGS__)
  6. #define fatal(fmt, ...) \
  7. do \
  8. { \
  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, const char *lvl, const char *fmt, ...);
  14. extern const char *REG_NAMES[32];
  15. #endif