logging.h 666 B

123456789101112131415161718192021222324252627
  1. #pragma once
  2. typedef enum {
  3. INFO = 0, /* Unimportant */
  4. NOTICE, /* Important, but not bad */
  5. WARNING, /* Not what was expected, but still okay */
  6. ERROR, /* This is bad... */
  7. CRITICAL, /* Shit */
  8. INSANE
  9. } log_type_t;
  10. extern log_type_t debug_level;
  11. extern void * debug_file;
  12. extern void _debug_print(char * title, int line_no, log_type_t level, char *fmt, ...);
  13. extern void (*debug_hook)(void *, char *);
  14. extern void (*debug_video_crash)(char **);
  15. #ifndef MODULE_NAME
  16. #define MODULE_NAME __FILE__
  17. #endif
  18. #ifndef QUIET
  19. #define debug_print(level, ...) _debug_print(MODULE_NAME, __LINE__, level, __VA_ARGS__)
  20. #else
  21. #define debug_print(level, ...)
  22. #endif