Logging & timeSDL 3.2

SDL_LogInfo

Logs an informational message in a category of your choice.

Signature

void SDL_LogInfo(int category, const char *fmt, ...);

How it works

Categories group messages (application, audio, render, input…) so you can make one area more verbose without drowning in the others. Priorities rank them: VERBOSE, DEBUG, INFO, WARN, ERROR, CRITICAL. A message is shown only if its priority is at least the category's current level (set with SDL_SetLogPriority).

SDL_LogVerbose, SDL_LogDebug, SDL_LogWarn and SDL_LogCritical work the same way at the other priorities.

Parameters

categoryint

The category.

Common values

SDL_LOG_CATEGORY_APPLICATION
Your own messages.
SDL_LOG_CATEGORY_RENDER / _VIDEO
Drawing and windows.
SDL_LOG_CATEGORY_AUDIO / _INPUT
Sound and input devices.
SDL_LOG_CATEGORY_CUSTOM
First number free for your own categories (CUSTOM, CUSTOM + 1…).
fmtconst char *

A printf format string, followed by its values.

Example

example.cpp
1SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "loaded %zu meshes", meshes.size());
Official SDL wiki