2D Run-and-gun shooter inspired by One Man's Doomsday, Counter-Strike, and Metal Slug.
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.
 
 
 
 
 
 

59 lines
1.3 KiB

  1. #ifndef IZ_LOG_H
  2. #define IZ_LOG_H
  3. #define BOLD "\x1B[0;1m" // Bold White
  4. #define RED "\x1B[0;31m"
  5. #define GRN "\x1B[0;32m"
  6. #define YEL "\x1B[0;33m"
  7. #define BLU "\x1B[0;34m"
  8. #define MAG "\x1B[0;35m"
  9. #define CYN "\x1B[0;36m"
  10. #define WHT "\x1B[0;37m"
  11. #define RESET "\x1B[0m"
  12. #define IZ_LOG_LEVEL_FLAG_DEBUG
  13. #define IZ_LOG_LEVEL_FLAG_INFO
  14. #define IZ_LOG_LEVEL_FLAG_WARN
  15. #define IZ_LOG_LEVEL_FLAG_ERROR
  16. #define IZ_LOG_WIDTH_TIMESTAMP "24"
  17. #define IZ_LOG_WIDTH_CATEGORY "14"
  18. #include <SDL_filesystem.h>
  19. #if defined IZ_WINDOWS
  20. #include <io.h>
  21. #include <SDL_syswm.h>
  22. #elif defined IZ_MACOS
  23. #include <unistd.h>
  24. #elif defined IZ_UNIX
  25. #include <unistd.h>
  26. #endif
  27. #include "../compat/IZ_compat.h"
  28. #include <stdbool.h>
  29. #include <stdarg.h>
  30. #include <stdio.h>
  31. #include <time.h>
  32. #include <stdlib.h>
  33. #include "../timer/IZ_timer.h"
  34. #include "../io/IZ_io.h"
  35. #include "../stdinc/IZ_string.h"
  36. typedef enum {
  37. IZ_LOG_CATEGORY_INPUT,
  38. IZ_LOG_CATEGORY_GLOBAL,
  39. IZ_LOG_CATEGORY_GENERIC,
  40. } IZ_LogCategory;
  41. static FILE* stdout_dest;
  42. static FILE* stderr_dest;
  43. void IZ_LogInitialize(const char*, bool);
  44. void IZ_LogError(const char*, const char*, ...);
  45. void IZ_LogInfo(IZ_LogCategory, const char*, const char*, ...);
  46. void IZ_LogWarn(bool, const char*, const char*, ...);
  47. void IZ_Log(const char*, const char*, ...);
  48. void IZ_LogTeardown(void);
  49. #endif