Logger.cpp 636 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #include "Logger.h"
  2. #include <stdio.h>
  3. #include <stdarg.h>
  4. using namespace WalrusRPG;
  5. void Logger::log(const char *fmt, ...)
  6. {
  7. printf(" [LOG] : ");
  8. va_list args;
  9. va_start(args, fmt);
  10. vprintf(fmt, args);
  11. }
  12. void Logger::debug(const char *fmt, ...)
  13. {
  14. printf("[DEBUG]: ");
  15. va_list args;
  16. va_start(args, fmt);
  17. vprintf(fmt, args);
  18. }
  19. void Logger::warn(const char *fmt, ...)
  20. {
  21. printf("[WARN] : ");
  22. va_list args;
  23. va_start(args, fmt);
  24. vprintf(fmt, args);
  25. }
  26. void Logger::error(const char *fmt, ...)
  27. {
  28. printf("[ERROR]: ");
  29. va_list args;
  30. va_start(args, fmt);
  31. vprintf(fmt, args);
  32. }