Debug Logging with SDL |
Debug Logging with SDL |
Alvin Beach
Guest
|
On 06/11/14 09:02, Jmuulian wrote:
Take a look here: http://wiki.libsdl.org/CategoryLog In particular, you can assign your own log writing function using this: http://wiki.libsdl.org/SDL_LogSetOutputFunction In your log output callback, just write /message/ and ignore the other parameters. For instance, I've used a custom log output callback to write to stdout and to log file. Alvin _______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
Jmuulian
|
Thanks for your response, but unless I'm mistaken that doesn't solve my problem. I actually do want SDL to handle the platform-specific details of the logging output, just without the additional formatting and complications described above.
Ideally, what I'd like to access is the function which takes the result of the log formatting, and outputs it in the appropriate manner for that platform. This functionality exists in SDL, but appears not to be exposed in the library interface. |
|||||||||||
|
Debug Logging with SDL |
Andreas Schiffler
Guest
|
Have a look at these SDLTest functions (see include/SDL_test_log.h and
/src/test/SDL_test_log.c): /** * \brief Prints given message with a timestamp in the TEST category and INFO priority. * * \param fmt Message to be logged */ void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); /** * \brief Prints given message with a timestamp in the TEST category and the ERROR priority. * * \param fmt Message to be logged */ void SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); On 11/6/2014 6:05 AM, Alvin Beach wrote:
_______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||||
|