Wiki Page Content

SDL_LogSetOutputFunction

Use this function to replace the default log output function with one of your own.

Syntax

void SDL_LogSetOutputFunction(SDL_LogOutputFunction callback,
                              void*                 userdata)

Function Parameters

callback

the function to call instead of the default; see Remarks for details

userdata

a pointer that is passed to callback

Code Examples

You can add your code example here

Remarks

The function prototype for callback is:

  • void SDL_LogOutputFunction(void*           userdata,
                               int             category,
                               SDL_LogPriority priority,
                               const char*     message)
    
  • where its parameters are:

    userdata

    what was passed as userdata to SDL_LogSetOutputFunction()

    category

    the category of the message; see Remarks for details

    priority

    the priority of the message; see Remarks for details

    message

    the message being output

    The category will be one of:

    SDL_LOG_CATEGORY_APPLICATION

    application log

    SDL_LOG_CATEGORY_ERROR

    error log

    SDL_LOG_CATEGORY_ASSERT

    assert log

    SDL_LOG_CATEGORY_SYSTEM

    system log

    SDL_LOG_CATEGORY_AUDIO

    audio log

    SDL_LOG_CATEGORY_VIDEO

    video log

    SDL_LOG_CATEGORY_RENDER

    render log

    SDL_LOG_CATEGORY_INPUT

    input log

    SDL_LOG_CATEGORY_TEST

    test log

    SDL_LOG_CATEGORY_RESERVED#

    # = 1-10; reserved for future SDL library use

    SDL_LOG_CATEGORY_CUSTOM

    reserved for application use; see Remarks for details

    The priority will be one of:

    SDL_LOG_PRIORITY_VERBOSE

    SDL_LOG_PRIORITY_DEBUG

    SDL_LOG_PRIORITY_INFO

    SDL_LOG_PRIORITY_WARN

    SDL_LOG_PRIORITY_ERROR

    SDL_LOG_PRIORITY_CRITICAL

    SDL_NUM_LOG_PRIORITIES

    (internal use)


CategoryAPI, CategoryLog

None: SDL_LogSetOutputFunction (last edited 2014-01-06 18:15:19 by JonathanDearborn)

Feedback
Please include your contact information if you'd like to receive a reply.
Submit