zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SDL_log.c File Reference
#include "SDL_config.h"
#include "SDL_log.h"

Go to the source code of this file.

Macros

#define DEFAULT_APPLICATION_PRIORITY   SDL_LOG_PRIORITY_INFO
 
#define DEFAULT_ASSERT_PRIORITY   SDL_LOG_PRIORITY_WARN
 
#define DEFAULT_PRIORITY   SDL_LOG_PRIORITY_CRITICAL
 
#define DEFAULT_TEST_PRIORITY   SDL_LOG_PRIORITY_VERBOSE
 

Typedefs

typedef struct SDL_LogLevel SDL_LogLevel
 

Functions

void SDL_Log (const char *fmt,...)
 Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO. More...
 
void SDL_LogCritical (int category, const char *fmt,...)
 Log a message with SDL_LOG_PRIORITY_CRITICAL. More...
 
void SDL_LogDebug (int category, const char *fmt,...)
 Log a message with SDL_LOG_PRIORITY_DEBUG. More...
 
void SDL_LogError (int category, const char *fmt,...)
 Log a message with SDL_LOG_PRIORITY_ERROR. More...
 
void SDL_LogGetOutputFunction (SDL_LogOutputFunction *callback, void **userdata)
 Get the current log output function. More...
 
SDL_LogPriority SDL_LogGetPriority (int category)
 Get the priority of a particular log category. More...
 
void SDL_LogInfo (int category, const char *fmt,...)
 Log a message with SDL_LOG_PRIORITY_INFO. More...
 
void SDL_LogMessage (int category, SDL_LogPriority priority, const char *fmt,...)
 Log a message with the specified category and priority. More...
 
void SDL_LogMessageV (int category, SDL_LogPriority priority, const char *fmt, va_list ap)
 Log a message with the specified category and priority. More...
 
static void SDL_LogOutput (void *userdata, int category, SDL_LogPriority priority, const char *message)
 
void SDL_LogResetPriorities (void)
 Reset all priorities to default. More...
 
void SDL_LogSetAllPriority (SDL_LogPriority priority)
 Set the priority of all log categories. More...
 
void SDL_LogSetOutputFunction (SDL_LogOutputFunction callback, void *userdata)
 This function allows you to replace the default log output function with one of your own. More...
 
void SDL_LogSetPriority (int category, SDL_LogPriority priority)
 Set the priority of a particular log category. More...
 
void SDL_LogVerbose (int category, const char *fmt,...)
 Log a message with SDL_LOG_PRIORITY_VERBOSE. More...
 
void SDL_LogWarn (int category, const char *fmt,...)
 Log a message with SDL_LOG_PRIORITY_WARN. More...
 
int SDL_SetError (const char *fmt,...)
 

Variables

static SDL_LogPriority SDL_application_priority = DEFAULT_APPLICATION_PRIORITY
 
static SDL_LogPriority SDL_assert_priority = DEFAULT_ASSERT_PRIORITY
 
static SDL_LogPriority SDL_default_priority = DEFAULT_PRIORITY
 
static SDL_LogOutputFunction SDL_log_function = SDL_LogOutput
 
static voidSDL_log_userdata = NULL
 
static SDL_LogLevelSDL_loglevels
 
static const char * SDL_priority_prefixes [SDL_NUM_LOG_PRIORITIES]
 
static SDL_LogPriority SDL_test_priority = DEFAULT_TEST_PRIORITY
 

Macro Definition Documentation

#define DEFAULT_APPLICATION_PRIORITY   SDL_LOG_PRIORITY_INFO

Definition at line 39 of file SDL_log.c.

Referenced by SDL_LogResetPriorities().

#define DEFAULT_ASSERT_PRIORITY   SDL_LOG_PRIORITY_WARN

Definition at line 38 of file SDL_log.c.

Referenced by SDL_LogResetPriorities().

#define DEFAULT_PRIORITY   SDL_LOG_PRIORITY_CRITICAL

Definition at line 37 of file SDL_log.c.

Referenced by SDL_LogResetPriorities().

#define DEFAULT_TEST_PRIORITY   SDL_LOG_PRIORITY_VERBOSE

Definition at line 40 of file SDL_log.c.

Referenced by SDL_LogResetPriorities().

Typedef Documentation

typedef struct SDL_LogLevel SDL_LogLevel

Function Documentation

void SDL_Log ( const char *  fmt,
  ... 
)

Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO.

Definition at line 173 of file SDL_log.c.

References SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, and SDL_LogMessageV().

Referenced by main().

void SDL_LogCritical ( int  category,
const char *  fmt,
  ... 
)

Log a message with SDL_LOG_PRIORITY_CRITICAL.

Definition at line 233 of file SDL_log.c.

References SDL_LOG_PRIORITY_CRITICAL, and SDL_LogMessageV().

void SDL_LogDebug ( int  category,
const char *  fmt,
  ... 
)

Log a message with SDL_LOG_PRIORITY_DEBUG.

Definition at line 193 of file SDL_log.c.

References SDL_LOG_PRIORITY_DEBUG, and SDL_LogMessageV().

void SDL_LogError ( int  category,
const char *  fmt,
  ... 
)

Log a message with SDL_LOG_PRIORITY_ERROR.

Definition at line 223 of file SDL_log.c.

References SDL_LOG_PRIORITY_ERROR, and SDL_LogMessageV().

Referenced by SDL_SetError().

void SDL_LogGetOutputFunction ( SDL_LogOutputFunction callback,
void **  userdata 
)

Get the current log output function.

Definition at line 415 of file SDL_log.c.

References SDL_log_function, and SDL_log_userdata.

SDL_LogPriority SDL_LogGetPriority ( int  category)

Get the priority of a particular log category.

Definition at line 134 of file SDL_log.c.

References SDL_application_priority, SDL_assert_priority, SDL_default_priority, SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_CATEGORY_ASSERT, SDL_LOG_CATEGORY_TEST, and SDL_test_priority.

Referenced by SDL_LogMessageV().

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

Log a message with SDL_LOG_PRIORITY_INFO.

Definition at line 203 of file SDL_log.c.

References SDL_LOG_PRIORITY_INFO, and SDL_LogMessageV().

Referenced by SDL_CreateRenderer().

void SDL_LogMessage ( int  category,
SDL_LogPriority  priority,
const char *  fmt,
  ... 
)

Log a message with the specified category and priority.

Definition at line 243 of file SDL_log.c.

References SDL_LogMessageV().

Referenced by SDLTest_Log(), and SDLTest_LogError().

void SDL_LogMessageV ( int  category,
SDL_LogPriority  priority,
const char *  fmt,
va_list  ap 
)
static void SDL_LogOutput ( void userdata,
int  category,
SDL_LogPriority  priority,
const char *  message 
)
static
void SDL_LogResetPriorities ( void  )
void SDL_LogSetAllPriority ( SDL_LogPriority  priority)

Set the priority of all log categories.

Definition at line 99 of file SDL_log.c.

References SDL_application_priority, SDL_assert_priority, and SDL_default_priority.

Referenced by SDLTest_CommonArg().

void SDL_LogSetOutputFunction ( SDL_LogOutputFunction  callback,
void userdata 
)

This function allows you to replace the default log output function with one of your own.

Definition at line 426 of file SDL_log.c.

References SDL_log_function, and SDL_log_userdata.

void SDL_LogSetPriority ( int  category,
SDL_LogPriority  priority 
)

Set the priority of a particular log category.

Definition at line 112 of file SDL_log.c.

References SDL_loglevels, and SDL_malloc().

Referenced by SDLTest_CommonArg().

void SDL_LogVerbose ( int  category,
const char *  fmt,
  ... 
)

Log a message with SDL_LOG_PRIORITY_VERBOSE.

Definition at line 183 of file SDL_log.c.

References SDL_LOG_PRIORITY_VERBOSE, and SDL_LogMessageV().

void SDL_LogWarn ( int  category,
const char *  fmt,
  ... 
)

Log a message with SDL_LOG_PRIORITY_WARN.

Definition at line 213 of file SDL_log.c.

References SDL_LOG_PRIORITY_WARN, and SDL_LogMessageV().

Variable Documentation

SDL_LogPriority SDL_application_priority = DEFAULT_APPLICATION_PRIORITY
static

Definition at line 60 of file SDL_log.c.

Referenced by SDL_LogGetPriority(), SDL_LogResetPriorities(), and SDL_LogSetAllPriority().

SDL_LogPriority SDL_assert_priority = DEFAULT_ASSERT_PRIORITY
static

Definition at line 59 of file SDL_log.c.

Referenced by SDL_LogGetPriority(), SDL_LogResetPriorities(), and SDL_LogSetAllPriority().

SDL_LogPriority SDL_default_priority = DEFAULT_PRIORITY
static

Definition at line 58 of file SDL_log.c.

Referenced by SDL_LogGetPriority(), SDL_LogResetPriorities(), and SDL_LogSetAllPriority().

SDL_LogOutputFunction SDL_log_function = SDL_LogOutput
static

Definition at line 62 of file SDL_log.c.

Referenced by SDL_LogGetOutputFunction(), SDL_LogMessageV(), and SDL_LogSetOutputFunction().

void* SDL_log_userdata = NULL
static

Definition at line 63 of file SDL_log.c.

Referenced by SDL_LogGetOutputFunction(), SDL_LogMessageV(), and SDL_LogSetOutputFunction().

SDL_LogLevel* SDL_loglevels
static

Definition at line 57 of file SDL_log.c.

Referenced by SDL_LogResetPriorities(), and SDL_LogSetPriority().

const char* SDL_priority_prefixes[SDL_NUM_LOG_PRIORITIES]
static
Initial value:
= {
"VERBOSE",
"DEBUG",
"INFO",
"WARN",
"ERROR",
"CRITICAL"
}
#define NULL
Definition: ftobjs.h:61

Definition at line 65 of file SDL_log.c.

Referenced by SDL_LogOutput().

SDL_LogPriority SDL_test_priority = DEFAULT_TEST_PRIORITY
static

Definition at line 61 of file SDL_log.c.

Referenced by SDL_LogGetPriority(), and SDL_LogResetPriorities().