diff --git a/inc/lzy.h b/inc/lzy.h index fedc82f..d64bef5 100644 --- a/inc/lzy.h +++ b/inc/lzy.h @@ -108,7 +108,7 @@ int LZY_PollEvent(LZY_Event *); void LZY_CycleEvents(void); int LZY_KeyDown(unsigned int key); int LZY_ShouldQuit(void); -void LZY_Log(const char *msg); +void LZY_Log(const char *fmt, ...); const char *LZY_GetError(void); #ifdef __cplusplus @@ -469,8 +469,8 @@ int LZY_ShouldQuit(void) { return should_quit; } -void LZY_Log(const char *msg) { - LZY_UNUSED(msg); +void LZY_Log(const char *fmt, ...) { + LZY_UNUSED(fmt); } const char *LZY_GetError(void) { @@ -1050,8 +1050,15 @@ int LZY_ShouldQuit(void) { return should_quit; } -void LZY_Log(const char *msg) { - SDL_Log("%s", msg); +void LZY_Log(const char *fmt, ...) { + char buf[2048] = {0}; + va_list args; + + va_start(args, fmt); + vsnprintf(buf, sizeof(buf) - 1, fmt, args); + va_end(args); + + SDL_Log("%s", buf); } const char *LZY_GetError(void) {