1
0

SDL_test_log.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
  4. This software is provided 'as-is', without any express or implied
  5. warranty. In no event will the authors be held liable for any damages
  6. arising from the use of this software.
  7. Permission is granted to anyone to use this software for any purpose,
  8. including commercial applications, and to alter it and redistribute it
  9. freely, subject to the following restrictions:
  10. 1. The origin of this software must not be misrepresented; you must not
  11. claim that you wrote the original software. If you use this software
  12. in a product, an acknowledgment in the product documentation would be
  13. appreciated but is not required.
  14. 2. Altered source versions must be plainly marked as such, and must not be
  15. misrepresented as being the original software.
  16. 3. This notice may not be removed or altered from any source distribution.
  17. */
  18. /**
  19. * Logging related functions of SDL test framework.
  20. *
  21. * This code is a part of the SDL test library, not the main SDL library.
  22. */
  23. /*
  24. *
  25. * Wrapper to log in the TEST category
  26. *
  27. */
  28. #ifndef SDL_test_log_h_
  29. #define SDL_test_log_h_
  30. #include <SDL3/SDL_stdinc.h>
  31. #include <SDL3/SDL_begin_code.h>
  32. /* Set up for C function definitions, even when using C++ */
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36. /**
  37. * Prints given message with a timestamp in the TEST category and INFO priority.
  38. *
  39. * \param fmt Message to be logged
  40. */
  41. void SDLCALL SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
  42. /**
  43. * Prints given prefix and buffer.
  44. * Non-printible characters in the raw data are substituted by printible alternatives.
  45. *
  46. * \param prefix Prefix message.
  47. * \param buffer Raw data to be escaped.
  48. * \param size Number of bytes in buffer.
  49. */
  50. void SDLCALL SDLTest_LogEscapedString(const char *prefix, const void *buffer, size_t size);
  51. /**
  52. * Prints given message with a timestamp in the TEST category and the ERROR priority.
  53. *
  54. * \param fmt Message to be logged
  55. */
  56. void SDLCALL SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
  57. /* Ends C function definitions when using C++ */
  58. #ifdef __cplusplus
  59. }
  60. #endif
  61. #include <SDL3/SDL_close_code.h>
  62. #endif /* SDL_test_log_h_ */