API reference / Application
SDL_Log
Function, SDL3
Prints a message, in the same way as printf. On the desktop it goes to the terminal, and in a browser it goes to the console.
Declaration
#include <SDL3/SDL.h>
void SDL_Log(const char *fmt, ...);Parameters
fmt | A format string, as in printf. |
... | The values for the format string. |
Example
SDL_Log("SDL_Init failed: %s", SDL_GetError());See this code run in Open a window. Download the full program (.zip)
Notes
- The message gets a newline for you.
In SDL2
The name is the same.