SDL 3.0
|
Go to the source code of this file.
Typedefs | |
typedef void(* | SDL_LogOutputFunction) (void *userdata, int category, SDL_LogPriority priority, const char *message) |
typedef void(* SDL_LogOutputFunction) (void *userdata, int category, SDL_LogPriority priority, const char *message) |
The prototype for the log output callback function.
This function is called by SDL when there is new text to be logged. A mutex is held so that this function is never called by more than one thread at once.
userdata | what was passed as userdata to SDL_SetLogOutputFunction(). |
category | the category of the message. |
priority | the priority of the message. |
message | the message being output. |
enum SDL_LogCategory |
Simple log messages with priorities and categories. A message's SDL_LogPriority signifies how important the message is. A message's SDL_LogCategory signifies from what domain it belongs to. Every category has a minimum priority specified: when a message belongs to that category, it will only be sent out if it has that minimum priority or higher.
SDL's own logs are sent below the default priority threshold, so they are quiet by default.
You can change the log verbosity programmatically using SDL_SetLogPriority() or with SDL_SetHint(SDL_HINT_LOGGING, ...), or with the "SDL_LOGGING" environment variable. This variable is a comma separated set of category=level tokens that define the default logging levels for SDL applications.
The category can be a numeric category, one of "app", "error", "assert", "system", "audio", "video", "render", "input", "test", or *
for any unspecified category.
The level can be a numeric level, one of "verbose", "debug", "info", "warn", "error", "critical", or "quiet" to disable that category.
You can omit the category if you want to set the logging level for all categories.
If this hint isn't set, the default log levels are equivalent to:
app=info,assert=warn,test=verbose,*=error
Here's where the messages go on different platforms:
By default the application and gpu categories are enabled at the INFO level, the assert category is enabled at the WARN level, test is enabled at the VERBOSE level and all other categories are enabled at the ERROR level.
Definition at line 81 of file SDL_log.h.
enum SDL_LogPriority |
The predefined log priorities
Definition at line 121 of file SDL_log.h.
|
extern |
Get the default log output function.
\threadsafety It is safe to call this function from any thread.
|
extern |
Get the current log output function.
callback | an SDL_LogOutputFunction filled in with the current log callback. |
userdata | a pointer filled in with the pointer that is passed to callback . |
\threadsafety It is safe to call this function from any thread.
|
extern |
Get the priority of a particular log category.
category | the category to query. |
\threadsafety It is safe to call this function from any thread.
|
extern |
Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO.
fmt | a printf() style message format string. |
... | additional parameters matching % tokens in the fmt string, if any. |
\threadsafety It is safe to call this function from any thread.
|
extern |
Log a message with SDL_LOG_PRIORITY_CRITICAL.
category | the category of the message. |
fmt | a printf() style message format string. |
... | additional parameters matching % tokens in the fmt string, if any. |
\threadsafety It is safe to call this function from any thread.
|
extern |
Log a message with SDL_LOG_PRIORITY_DEBUG.
category | the category of the message. |
fmt | a printf() style message format string. |
... | additional parameters matching % tokens in the fmt string, if any. |
\threadsafety It is safe to call this function from any thread.
|
extern |
Log a message with SDL_LOG_PRIORITY_ERROR.
category | the category of the message. |
fmt | a printf() style message format string. |
... | additional parameters matching % tokens in the fmt string, if any. |
\threadsafety It is safe to call this function from any thread.
|
extern |
Log a message with SDL_LOG_PRIORITY_INFO.
category | the category of the message. |
fmt | a printf() style message format string. |
... | additional parameters matching % tokens in the fmt string, if any. |
\threadsafety It is safe to call this function from any thread.
|
extern |
Log a message with the specified category and priority.
category | the category of the message. |
priority | the priority of the message. |
fmt | a printf() style message format string. |
... | additional parameters matching % tokens in the fmt string, if any. |
\threadsafety It is safe to call this function from any thread.
|
extern |
Log a message with the specified category and priority.
category | the category of the message. |
priority | the priority of the message. |
fmt | a printf() style message format string. |
ap | a variable argument list. |
\threadsafety It is safe to call this function from any thread.
|
extern |
Log a message with SDL_LOG_PRIORITY_TRACE.
category | the category of the message. |
fmt | a printf() style message format string. |
... | additional parameters matching % tokens in the fmt string, if any. |
\threadsafety It is safe to call this function from any thread.
|
extern |
Log a message with SDL_LOG_PRIORITY_VERBOSE.
category | the category of the message. |
fmt | a printf() style message format string. |
... | additional parameters matching % tokens in the fmt string, if any. |
\threadsafety It is safe to call this function from any thread.
|
extern |
Log a message with SDL_LOG_PRIORITY_WARN.
category | the category of the message. |
fmt | a printf() style message format string. |
... | additional parameters matching % tokens in the fmt string, if any. |
\threadsafety It is safe to call this function from any thread.
|
extern |
Reset all priorities to default.
This is called by SDL_Quit().
\threadsafety It is safe to call this function from any thread.
|
extern |
Replace the default log output function with one of your own.
callback | an SDL_LogOutputFunction to call instead of the default. |
userdata | a pointer that is passed to callback . |
\threadsafety It is safe to call this function from any thread.
|
extern |
Set the priority of all log categories.
priority | the SDL_LogPriority to assign. |
\threadsafety It is safe to call this function from any thread.
|
extern |
Set the priority of a particular log category.
category | the category to assign a priority to. |
priority | the SDL_LogPriority to assign. |
\threadsafety It is safe to call this function from any thread.
|
extern |
Set the text prepended to log messages of a given priority.
By default SDL_LOG_PRIORITY_INFO and below have no prefix, and SDL_LOG_PRIORITY_WARN and higher have a prefix showing their priority, e.g. "WARNING: ".
priority | the SDL_LogPriority to modify. |
prefix | the prefix to use for that log priority, or NULL to use no prefix. |
\threadsafety It is safe to call this function from any thread.