SDL School

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

fmtA format string, as in printf.
...The values for the format string.

Example

Open a window
SDL_Log("SDL_Init failed: %s", SDL_GetError());

See this code run in Open a window. Download the full program (.zip)

Notes

In SDL2

The name is the same.

See also