+
+#include <stdio.h>
+#include <stdarg.h>
+#include <SDL2/SDL_log.h>
+
+void __attribute__ ((format (printf, 1, 2))) _print_info(const char *format, ...)
+{
+ va_list args;
+ va_start(args, format);
+
+ SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, format, args);
+
+ va_end(args);
+}
+
+void __attribute__ ((format (printf, 3, 4))) _print_error(const char *_file, int _line, const char *format, ...)
+{
+ va_list args;
+ va_start(args, format);
+
+ SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_ERROR, "Error in %s line %d:\n", _file, _line);
+ SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_ERROR, format, args);
+
+ va_end(args);
+}
+