Re-implementation of Izanami game engine
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.

54 lines
1.0 KiB

  1. #ifndef IZ_LOG_H
  2. #define IZ_LOG_H
  3. #ifdef _WIN64
  4. #define RED ""
  5. #define GRN ""
  6. #define YEL ""
  7. #define BLU ""
  8. #define MAG ""
  9. #define CYN ""
  10. #define WHT ""
  11. #define RESET ""
  12. #else
  13. #define RED "\x1B[31m"
  14. #define GRN "\x1B[32m"
  15. #define YEL "\x1B[33m"
  16. #define BLU "\x1B[34m"
  17. #define MAG "\x1B[35m"
  18. #define CYN "\x1B[36m"
  19. #define WHT "\x1B[37m"
  20. #define RESET "\x1B[0m"
  21. #endif
  22. #define IZ_LOG_LEVEL_FLAG_DEBUG
  23. #define IZ_LOG_LEVEL_FLAG_INFO
  24. #define IZ_LOG_LEVEL_FLAG_WARN
  25. #define IZ_LOG_LEVEL_FLAG_ERROR
  26. //#define IZ_LOG_DATE_FUNCTION IZ_TimerElapsed
  27. #define IZ_LOG_DATE_FUNCTION IZ_TimerNow
  28. #include <stdbool.h>
  29. #include <stdarg.h>
  30. #include <stdio.h>
  31. #include <time.h>
  32. #include "../timer/IZ_timer.h"
  33. typedef enum {
  34. IZ_LOG_CATEGORY_INPUT,
  35. IZ_LOG_CATEGORY_GLOBAL,
  36. IZ_LOG_CATEGORY_GENERIC,
  37. } IZ_LogCategory;
  38. void IZ_LogError(const char* fmt, ...);
  39. void IZ_LogInfo(IZ_LogCategory category, const char* fmt, ...);
  40. void IZ_LogWarn(bool is_critical, const char* fmt, ...);
  41. void IZ_Log(const char* fmt, ...);
  42. #endif