SDL: Updated logging functions for SDL3 naming convention

From 4609af618ab36a86f1f70509d9aa75bb286dcd46 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Thu, 16 May 2024 10:00:50 -0700
Subject: [PATCH] Updated logging functions for SDL3 naming convention

---
 build-scripts/SDL_migration.cocci     | 20 ++++++++++++++++++++
 docs/README-migration.md              |  4 ++++
 include/SDL3/SDL_log.h                | 26 +++++++++++++-------------
 include/SDL3/SDL_oldnames.h           |  8 ++++++++
 src/SDL_error.c                       |  2 +-
 src/SDL_log.c                         | 12 ++++++------
 src/dynapi/SDL_dynapi.sym             |  8 ++++----
 src/dynapi/SDL_dynapi_overrides.h     |  8 ++++----
 src/dynapi/SDL_dynapi_procs.h         |  8 ++++----
 src/test/SDL_test_common.c            | 14 +++++++-------
 test/checkkeys.c                      |  2 +-
 test/checkkeysthreads.c               |  2 +-
 test/loopwave.c                       |  2 +-
 test/testatomic.c                     |  2 +-
 test/testaudiocapture.c               |  2 +-
 test/testaudiohotplug.c               |  2 +-
 test/testaudioinfo.c                  |  2 +-
 test/testaudiostreamdynamicresample.c |  2 +-
 test/testcamera.c                     |  4 ++--
 test/testcontroller.c                 |  2 +-
 test/testcustomcursor.c               |  2 +-
 test/testdialog.c                     |  2 +-
 test/testdisplayinfo.c                |  2 +-
 test/testdraw.c                       |  2 +-
 test/testdrawchessboard.c             |  2 +-
 test/testdropfile.c                   |  2 +-
 test/testerror.c                      |  2 +-
 test/testffmpeg.c                     |  2 +-
 test/testfile.c                       |  2 +-
 test/testfilesystem.c                 |  2 +-
 test/testgeometry.c                   |  2 +-
 test/testgl.c                         |  2 +-
 test/testgles.c                       |  2 +-
 test/testhaptic.c                     |  2 +-
 test/testhittesting.c                 |  2 +-
 test/testhotplug.c                    |  4 ++--
 test/testiconv.c                      |  2 +-
 test/testime.c                        |  2 +-
 test/testintersections.c              |  2 +-
 test/testkeys.c                       |  2 +-
 test/testloadso.c                     |  2 +-
 test/testlocale.c                     |  2 +-
 test/testlock.c                       |  2 +-
 test/testmanymouse.c                  |  2 +-
 test/testmessage.c                    |  2 +-
 test/testmodal.c                      |  2 +-
 test/testmouse.c                      |  2 +-
 test/testmultiaudio.c                 |  2 +-
 test/testnative.c                     |  2 +-
 test/testoffscreen.c                  |  2 +-
 test/testplatform.c                   |  2 +-
 test/testpopup.c                      |  2 +-
 test/testpower.c                      |  2 +-
 test/testrelative.c                   |  2 +-
 test/testrendercopyex.c               |  2 +-
 test/testrendertarget.c               |  2 +-
 test/testresample.c                   |  2 +-
 test/testrumble.c                     |  2 +-
 test/testrwlock.c                     |  2 +-
 test/testscale.c                      |  2 +-
 test/testsem.c                        |  2 +-
 test/testsensor.c                     |  2 +-
 test/testshader.c                     |  2 +-
 test/testspriteminimal.c              |  2 +-
 test/teststreaming.c                  |  2 +-
 test/testsurround.c                   |  2 +-
 test/testthread.c                     |  2 +-
 test/testtime.c                       |  2 +-
 test/testtimer.c                      |  2 +-
 test/testver.c                        |  2 +-
 test/testvulkan.c                     |  2 +-
 test/testwm.c                         |  2 +-
 test/testyuv.c                        |  2 +-
 test/torturethread.c                  |  2 +-
 74 files changed, 137 insertions(+), 105 deletions(-)

diff --git a/build-scripts/SDL_migration.cocci b/build-scripts/SDL_migration.cocci
index d4e4f0d09e29e..83f8165a6b12f 100644
--- a/build-scripts/SDL_migration.cocci
+++ b/build-scripts/SDL_migration.cocci
@@ -3159,3 +3159,23 @@ typedef SDL_Colour, SDL_Color;
 @@
 - SDLK_QUOTEDBL
 + SDLK_DBLAPOSTROPHE
+@@
+@@
+- SDL_LogSetAllPriority
++ SDL_SetLogPriorities
+  (...)
+@@
+@@
+- SDL_LogSetPriority
++ SDL_SetLogPriority
+  (...)
+@@
+@@
+- SDL_LogGetPriority
++ SDL_GetLogPriority
+  (...)
+@@
+@@
+- SDL_LogResetPriorities
++ SDL_ResetLogPriorities
+  (...)
diff --git a/docs/README-migration.md b/docs/README-migration.md
index bb85f65d79675..1c9c8ef07cf19 100644
--- a/docs/README-migration.md
+++ b/docs/README-migration.md
@@ -918,7 +918,11 @@ The following macros have been removed:
 
 The following functions have been renamed:
 * SDL_LogGetOutputFunction() => SDL_GetLogOutputFunction()
+* SDL_LogGetPriority() => SDL_GetLogPriority()
+* SDL_LogResetPriorities() => SDL_ResetLogPriorities()
+* SDL_LogSetAllPriority() => SDL_SetLogPriorities()
 * SDL_LogSetOutputFunction() => SDL_SetLogOutputFunction()
+* SDL_LogSetPriority() => SDL_SetLogPriority()
 
 ## SDL_main.h
 
diff --git a/include/SDL3/SDL_log.h b/include/SDL3/SDL_log.h
index 5fe930c8617b0..d2cc1a18bf065 100644
--- a/include/SDL3/SDL_log.h
+++ b/include/SDL3/SDL_log.h
@@ -26,7 +26,7 @@
  *
  * By default logs are quiet, but if you're debugging SDL you might want:
  *
- * SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN);
+ * SDL_SetLogPriorities(SDL_LOG_PRIORITY_WARN);
  *
  * Here's where the messages go on different platforms:
  *
@@ -114,10 +114,10 @@ typedef enum SDL_LogPriority
  *
  * \since This function is available since SDL 3.0.0.
  *
- * \sa SDL_LogResetPriorities
- * \sa SDL_LogSetPriority
+ * \sa SDL_ResetLogPriorities
+ * \sa SDL_SetLogPriority
  */
-extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority);
+extern DECLSPEC void SDLCALL SDL_SetLogPriorities(SDL_LogPriority priority);
 
 /**
  * Set the priority of a particular log category.
@@ -127,11 +127,11 @@ extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority);
  *
  * \since This function is available since SDL 3.0.0.
  *
- * \sa SDL_LogGetPriority
- * \sa SDL_LogResetPriorities
- * \sa SDL_LogSetAllPriority
+ * \sa SDL_GetLogPriority
+ * \sa SDL_ResetLogPriorities
+ * \sa SDL_SetLogPriorities
  */
-extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category,
+extern DECLSPEC void SDLCALL SDL_SetLogPriority(int category,
                                                 SDL_LogPriority priority);
 
 /**
@@ -142,9 +142,9 @@ extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category,
  *
  * \since This function is available since SDL 3.0.0.
  *
- * \sa SDL_LogSetPriority
+ * \sa SDL_SetLogPriority
  */
-extern DECLSPEC SDL_LogPriority SDLCALL SDL_LogGetPriority(int category);
+extern DECLSPEC SDL_LogPriority SDLCALL SDL_GetLogPriority(int category);
 
 /**
  * Reset all priorities to default.
@@ -153,10 +153,10 @@ extern DECLSPEC SDL_LogPriority SDLCALL SDL_LogGetPriority(int category);
  *
  * \since This function is available since SDL 3.0.0.
  *
- * \sa SDL_LogSetAllPriority
- * \sa SDL_LogSetPriority
+ * \sa SDL_SetLogPriorities
+ * \sa SDL_SetLogPriority
  */
-extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void);
+extern DECLSPEC void SDLCALL SDL_ResetLogPriorities(void);
 
 /**
  * Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO.
diff --git a/include/SDL3/SDL_oldnames.h b/include/SDL3/SDL_oldnames.h
index b985362302742..c345acceb20b8 100644
--- a/include/SDL3/SDL_oldnames.h
+++ b/include/SDL3/SDL_oldnames.h
@@ -360,7 +360,11 @@
 
 /* ##SDL_log.h */
 #define SDL_LogGetOutputFunction SDL_GetLogOutputFunction
+#define SDL_LogGetPriority SDL_GetLogPriority
+#define SDL_LogResetPriorities SDL_ResetLogPriorities
+#define SDL_LogSetAllPriority SDL_SetLogPriorities
 #define SDL_LogSetOutputFunction SDL_SetLogOutputFunction
+#define SDL_LogSetPriority SDL_SetLogPriority
 
 /* ##SDL_mouse.h */
 #define SDL_FreeCursor SDL_DestroyCursor
@@ -870,7 +874,11 @@
 
 /* ##SDL_log.h */
 #define SDL_LogGetOutputFunction SDL_LogGetOutputFunction_renamed_SDL_GetLogOutputFunction
+#define SDL_LogGetPriority SDL_LogGetPriority_renamed_SDL_GetLogPriority
+#define SDL_LogResetPriorities SDL_LogResetPriorities_renamed_SDL_ResetLogPriorities
+#define SDL_LogSetAllPriority SDL_LogSetAllPriority_renamed_SDL_SetLogPriorities
 #define SDL_LogSetOutputFunction SDL_LogSetOutputFunction_renamed_SDL_SetLogOutputFunction
+#define SDL_LogSetPriority SDL_LogSetPriority_renamed_SDL_SetLogPriority
 
 /* ##SDL_mouse.h */
 #define SDL_FreeCursor SDL_FreeCursor_renamed_SDL_DestroyCursor
diff --git a/src/SDL_error.c b/src/SDL_error.c
index 0ce4a95f74eb7..679a067699eca 100644
--- a/src/SDL_error.c
+++ b/src/SDL_error.c
@@ -50,7 +50,7 @@ int SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...)
             }
         }
 
-        if (SDL_LogGetPriority(SDL_LOG_CATEGORY_ERROR) <= SDL_LOG_PRIORITY_DEBUG) {
+        if (SDL_GetLogPriority(SDL_LOG_CATEGORY_ERROR) <= SDL_LOG_PRIORITY_DEBUG) {
             /* If we are in debug mode, print out the error message */
             SDL_LogDebug(SDL_LOG_CATEGORY_ERROR, "%s", error->str);
         }
diff --git a/src/SDL_log.c b/src/SDL_log.c
index 2baf16a0f9996..eef32b350874c 100644
--- a/src/SDL_log.c
+++ b/src/SDL_log.c
@@ -117,14 +117,14 @@ void SDL_InitLog(void)
 
 void SDL_QuitLog(void)
 {
-    SDL_LogResetPriorities();
+    SDL_ResetLogPriorities();
     if (log_function_mutex) {
         SDL_DestroyMutex(log_function_mutex);
         log_function_mutex = NULL;
     }
 }
 
-void SDL_LogSetAllPriority(SDL_LogPriority priority)
+void SDL_SetLogPriorities(SDL_LogPriority priority)
 {
     SDL_LogLevel *entry;
 
@@ -136,7 +136,7 @@ void SDL_LogSetAllPriority(SDL_LogPriority priority)
     SDL_forced_priority_level = priority;
 }
 
-void SDL_LogSetPriority(int category, SDL_LogPriority priority)
+void SDL_SetLogPriority(int category, SDL_LogPriority priority)
 {
     SDL_LogLevel *entry;
 
@@ -273,7 +273,7 @@ static SDL_LogPriority SDL_GetDefaultLogPriority(int category)
     }
 }
 
-SDL_LogPriority SDL_LogGetPriority(int category)
+SDL_LogPriority SDL_GetLogPriority(int category)
 {
     SDL_LogLevel *entry;
 
@@ -290,7 +290,7 @@ SDL_LogPriority SDL_LogGetPriority(int category)
     return SDL_GetDefaultLogPriority(category);
 }
 
-void SDL_LogResetPriorities(void)
+void SDL_ResetLogPriorities(void)
 {
     SDL_LogLevel *entry;
 
@@ -406,7 +406,7 @@ void SDL_LogMessageV(int category, SDL_LogPriority priority, SDL_PRINTF_FORMAT_S
     }
 
     /* See if we want to do anything with this message */
-    if (priority < SDL_LogGetPriority(category)) {
+    if (priority < SDL_GetLogPriority(category)) {
         return;
     }
 
diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym
index 919998f84f984..b8d8d266fbf3f 100644
--- a/src/dynapi/SDL_dynapi.sym
+++ b/src/dynapi/SDL_dynapi.sym
@@ -555,13 +555,13 @@ SDL3_0.0.0 {
     SDL_LogCritical;
     SDL_LogDebug;
     SDL_LogError;
-    SDL_LogGetPriority;
+    SDL_GetLogPriority;
     SDL_LogInfo;
     SDL_LogMessage;
     SDL_LogMessageV;
-    SDL_LogResetPriorities;
-    SDL_LogSetAllPriority;
-    SDL_LogSetPriority;
+    SDL_ResetLogPriorities;
+    SDL_SetLogPriorities;
+    SDL_SetLogPriority;
     SDL_LogVerbose;
     SDL_LogWarn;
     SDL_MapRGB;
diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h
index 335134bfbb7b2..9d4d6415d86b8 100644
--- a/src/dynapi/SDL_dynapi_overrides.h
+++ b/src/dynapi/SDL_dynapi_overrides.h
@@ -580,13 +580,13 @@
 #define SDL_LogCritical SDL_LogCritical_REAL
 #define SDL_LogDebug    SDL_LogDebug_REAL
 #define SDL_LogError    SDL_LogError_REAL
-#define SDL_LogGetPriority SDL_LogGetPriority_REAL
+#define SDL_GetLogPriority SDL_GetLogPriority_REAL
 #define SDL_LogInfo SDL_LogInfo_REAL
 #define SDL_LogMessage  SDL_LogMessage_REAL
 #define SDL_LogMessageV SDL_LogMessageV_REAL
-#define SDL_LogResetPriorities SDL_LogResetPriorities_REAL
-#define SDL_LogSetAllPriority SDL_LogSetAllPriority_REAL
-#define SDL_LogSetPriority SDL_LogSetPriority_REAL
+#define SDL_ResetLogPriorities SDL_ResetLogPriorities_REAL
+#define SDL_SetLogPriorities SDL_SetLogPriorities_REAL
+#define SDL_SetLogPriority SDL_SetLogPriority_REAL
 #define SDL_LogVerbose  SDL_LogVerbose_REAL
 #define SDL_LogWarn SDL_LogWarn_REAL
 #define SDL_MapRGB SDL_MapRGB_REAL
diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h
index a764c8df6654e..26a02238824a3 100644
--- a/src/dynapi/SDL_dynapi_procs.h
+++ b/src/dynapi/SDL_dynapi_procs.h
@@ -606,11 +606,11 @@ SDL_DYNAPI_PROC(void,SDL_LockSpinlock,(SDL_SpinLock *a),(a),)
 SDL_DYNAPI_PROC(int,SDL_LockSurface,(SDL_Surface *a),(a),return)
 SDL_DYNAPI_PROC(int,SDL_LockTexture,(SDL_Texture *a, const SDL_Rect *b, void **c, int *d),(a,b,c,d),return)
 SDL_DYNAPI_PROC(int,SDL_LockTextureToSurface,(SDL_Texture *a, const SDL_Rect *b, SDL_Surface **c),(a,b,c),return)
-SDL_DYNAPI_PROC(SDL_LogPriority,SDL_LogGetPriority,(int a),(a),return)
+SDL_DYNAPI_PROC(SDL_LogPriority,SDL_GetLogPriority,(int a),(a),return)
 SDL_DYNAPI_PROC(void,SDL_LogMessageV,(int a, SDL_LogPriority b, SDL_PRINTF_FORMAT_STRING const char *c, va_list d),(a,b,c,d),)
-SDL_DYNAPI_PROC(void,SDL_LogResetPriorities,(void),(),)
-SDL_DYNAPI_PROC(void,SDL_LogSetAllPriority,(SDL_LogPriority a),(a),)
-SDL_DYNAPI_PROC(void,SDL_LogSetPriority,(int a, SDL_LogPriority b),(a,b),)
+SDL_DYNAPI_PROC(void,SDL_ResetLogPriorities,(void),(),)
+SDL_DYNAPI_PROC(void,SDL_SetLogPriorities,(SDL_LogPriority a),(a),)
+SDL_DYNAPI_PROC(void,SDL_SetLogPriority,(int a, SDL_LogPriority b),(a,b),)
 SDL_DYNAPI_PROC(Uint32,SDL_MapRGB,(const SDL_PixelFormat *a, Uint8 b, Uint8 c, Uint8 d),(a,b,c,d),return)
 SDL_DYNAPI_PROC(Uint32,SDL_MapRGBA,(const SDL_PixelFormat *a, Uint8 b, Uint8 c, Uint8 d, Uint8 e),(a,b,c,d,e),return)
 SDL_DYNAPI_PROC(int,SDL_MaximizeWindow,(SDL_Window *a),(a),return)
diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c
index 684b2837a65cc..8a9fbf193d23d 100644
--- a/src/test/SDL_test_common.c
+++ b/src/test/SDL_test_common.c
@@ -181,31 +181,31 @@ int SDLTest_CommonArg(SDLTest_CommonState *state, int index)
             return -1;
         }
         if (SDL_strcasecmp(argv[index], "all") == 0) {
-            SDL_LogSetAllPriority(SDL_LOG_PRIORITY_VERBOSE);
+            SDL_SetLogPriorities(SDL_LOG_PRIORITY_VERBOSE);
             return 2;
         }
         if (SDL_strcasecmp(argv[index], "error") == 0) {
-            SDL_LogSetPriority(SDL_LOG_CATEGORY_ERROR, SDL_LOG_PRIORITY_VERBOSE);
+            SDL_SetLogPriority(SDL_LOG_CATEGORY_ERROR, SDL_LOG_PRIORITY_VERBOSE);
             return 2;
         }
         if (SDL_strcasecmp(argv[index], "system") == 0) {
-            SDL_LogSetPriority(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_VERBOSE);
+            SDL_SetLogPriority(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_VERBOSE);
             return 2;
         }
         if (SDL_strcasecmp(argv[index], "audio") == 0) {
-            SDL_LogSetPriority(SDL_LOG_CATEGORY_AUDIO, SDL_LOG_PRIORITY_VERBOSE);
+            SDL_SetLogPriority(SDL_LOG_CATEGORY_AUDIO, SDL_LOG_PRIORITY_VERBOSE);
             return 2;
         }
         if (SDL_strcasecmp(argv[index], "video") == 0) {
-            SDL_LogSetPriority(SDL_LOG_CATEGORY_VIDEO, SDL_LOG_PRIORITY_VERBOSE);
+            SDL_SetLogPriority(SDL_LOG_CATEGORY_VIDEO, SDL_LOG_PRIORITY_VERBOSE);
             return 2;
         }
         if (SDL_strcasecmp(argv[index], "render") == 0) {
-            SDL_LogSetPriority(SDL_LOG_CATEGORY_RENDER, SDL_LOG_PRIORITY_VERBOSE);
+            SDL_SetLogPriority(SDL_LOG_CATEGORY_RENDER, SDL_LOG_PRIORITY_VERBOSE);
             return 2;
         }
         if (SDL_strcasecmp(argv[index], "input") == 0) {
-            SDL_LogSetPriority(SDL_LOG_CATEGORY_INPUT, SDL_LOG_PRIORITY_VERBOSE);
+            SDL_SetLogPriority(SDL_LOG_CATEGORY_INPUT, SDL_LOG_PRIORITY_VERBOSE);
             return 2;
         }
         return -1;
diff --git a/test/checkkeys.c b/test/checkkeys.c
index 6c1cefba14188..e0baa5e052065 100644
--- a/test/checkkeys.c
+++ b/test/checkkeys.c
@@ -247,7 +247,7 @@ int main(int argc, char *argv[])
     state->window_title = "CheckKeys Test";
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     /* Parse commandline */
     if (!SDLTest_CommonDefaultArgs(state, argc, argv)) {
diff --git a/test/checkkeysthreads.c b/test/checkkeysthreads.c
index 4a1c08def2cc8..6630f17c02468 100644
--- a/test/checkkeysthreads.c
+++ b/test/checkkeysthreads.c
@@ -252,7 +252,7 @@ int main(int argc, char *argv[])
     }
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     /* Parse commandline */
     if (!SDLTest_CommonDefaultArgs(state, argc, argv)) {
diff --git a/test/loopwave.c b/test/loopwave.c
index 5ff01511948f2..c7567739045d5 100644
--- a/test/loopwave.c
+++ b/test/loopwave.c
@@ -57,7 +57,7 @@ int SDL_AppInit(void **appstate, int argc, char *argv[])
     }
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     /* Parse commandline */
     for (i = 1; i < argc;) {
diff --git a/test/testatomic.c b/test/testatomic.c
index c2cca74283cd1..d82559ad3f59a 100644
--- a/test/testatomic.c
+++ b/test/testatomic.c
@@ -706,7 +706,7 @@ int main(int argc, char *argv[])
     }
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     /* Parse commandline */
     if (!SDLTest_CommonDefaultArgs(state, argc, argv)) {
diff --git a/test/testaudiocapture.c b/test/testaudiocapture.c
index a1a88be2b6fc1..ba5cac8d4751f 100644
--- a/test/testaudiocapture.c
+++ b/test/testaudiocapture.c
@@ -41,7 +41,7 @@ int SDL_AppInit(void **appstate, int argc, char **argv)
     }
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     /* Parse commandline */
     for (i = 1; i < argc;) {
diff --git a/test/testaudiohotplug.c b/test/testaudiohotplug.c
index 79bb14d31b87b..12b3a45103d37 100644
--- a/test/testaudiohotplug.c
+++ b/test/testaudiohotplug.c
@@ -124,7 +124,7 @@ int main(int argc, char *argv[])
     }
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     /* Parse commandline */
     for (i = 1; i < argc;) {
diff --git a/test/testaudioinfo.c b/test/testaudioinfo.c
index 4ac371c011a37..270e10603ad6e 100644
--- a/test/testaudioinfo.c
+++ b/test/testaudioinfo.c
@@ -65,7 +65,7 @@ int main(int argc, char **argv)
     }
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     /* Parse commandline */
     if (!SDLTest_CommonDefaultArgs(state, argc, argv)) {
diff --git a/test/testaudiostreamdynamicresample.c b/test/testaudiostreamdynamicresample.c
index 1db69ecf3303a..5a83bea76e7cb 100644
--- a/test/testaudiostreamdynamicresample.c
+++ b/test/testaudiostreamdynamicresample.c
@@ -377,7 +377,7 @@ int main(int argc, char *argv[])
     }
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     /* Parse commandline */
     for (i = 1; i < argc;) {
diff --git a/test/testcamera.c b/test/testcamera.c
index 25cbd09143709..e5fbd5c4835d1 100644
--- a/test/testcamera.c
+++ b/test/testcamera.c
@@ -38,7 +38,7 @@ int SDL_AppInit(void **appstate, int argc, char *argv[])
     }
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     if (!SDLTest_CommonDefaultArgs(state, argc, argv)) {
         return -1;
@@ -58,7 +58,7 @@ int SDL_AppInit(void **appstate, int argc, char *argv[])
         return -1;
     }
 
-    SDL_LogSetAllPriority(SDL_LOG_PRIORITY_VERBOSE);
+    SDL_SetLogPriorities(SDL_LOG_PRIORITY_VERBOSE);
 
     renderer = state->renderers[0];
     if (!renderer) {
diff --git a/test/testcontroller.c b/test/testcontroller.c
index 74b7a1355dc68..600674bf26f78 100644
--- a/test/testcontroller.c
+++ b/test/testcontroller.c
@@ -1961,7 +1961,7 @@ int main(int argc, char *argv[])
     SDL_SetHint(SDL_HINT_JOYSTICK_LINUX_DEADZONES, "1");
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     /* Parse commandline */
     for (i = 1; i < argc;) {
diff --git a/test/testcustomcursor.c b/test/testcustomcursor.c
index ba0cab050b416..813c6a48a07fd 100644
--- a/test/testcustomcursor.c
+++ b/test/testcustomcursor.c
@@ -343,7 +343,7 @@ int main(int argc, char *argv[])
     SDL_Cursor *cursor;
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     /* Initialize test framework */
     state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO);
diff --git a/test/testdialog.c b/test/testdialog.c
index 378cc6d6ce14b..d5e9365424ecc 100644
--- a/test/testdialog.c
+++ b/test/testdialog.c
@@ -62,7 +62,7 @@ int main(int argc, char *argv[]) {
     }
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     /* Parse commandline */
     for (i = 1; i < argc;) {
diff --git a/test/testdisplayinfo.c b/test/testdisplayinfo.c
index 81c6f709fd124..fa9ed7b4333c1 100644
--- a/test/testdisplayinfo.c
+++ b/test/testdisplayinfo.c
@@ -46,7 +46,7 @@ int main(int argc, char *argv[])
     }
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     /* Parse commandline */
     if (!SDLTest_CommonDefaultArgs(state, argc, argv)) {
diff --git a/test/testdraw.c b/test/testdraw.c
index 25408cebc692f..1458937584140 100644
--- a/test/testdraw.c
+++ b/test/testdraw.c
@@ -222,7 +222,7 @@ int main(int argc, char *argv[])
     int i;
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     /* Initialize parameters */
     num_objects = NUM_OBJECTS;
diff --git a/test/testdrawchessboard.c b/test/testdrawchessboard.c
index fb3b32d9289a2..45f37a468ff03 100644
--- a/test/testdrawchessboard.c
+++ b/test/testdrawchessboard.c
@@ -112,7 +112,7 @@ int main(int argc, char *argv[])
     }
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     /* Parse commandline */
     if (!SDLTest_CommonDefaultArgs(state, argc, argv)) {
diff --git a/test/testdropfile.c b/test/testdropfile.c
index 0c0bfca746cda..6b5ce539c690f 100644
--- a/test/testdropfile.c
+++ b/test/testdropfile.c
@@ -31,7 +31,7 @@ int main(int argc, char *argv[])
     }
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     for (i = 1; i < argc;) {
         int consumed;
diff --git a/test/testerror.c b/test/testerror.c
index 3171403756bbb..5ceca0a3eb803 100644
--- a/test/testerror.c
+++ b/test/testerror.c
@@ -57,7 +57,7 @@ int main(int argc, char *argv[])
     }
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     /* Parse commandline */
     if (!SDLTest_CommonDefaultArgs(state, argc, argv)) {
diff --git a/test/testffmpeg.c b/test/testffmpeg.c
index db8025f4e994a..e2fd85f7e2c0d 100644
--- a/test/testffmpeg.c
+++ b/test/testffmpeg.c
@@ -1323,7 +1323,7 @@ int main(int argc, char *argv[])
     state = SDLTest_CommonCreateState(argv, 0);
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     /* Log ffmpeg messages */
     av_log_set_callback( av_log_callback );
diff --git a/test/testfile.c b/test/testfile.c
index 30e41844eb6d1..a2eab48f86fb9 100644
--- a/test/testfile.c
+++ b/test/testfile.c
@@ -76,7 +76,7 @@ int main(int argc, char *argv[])
     }
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     /* Parse commandline */
     if (!SDLTest_CommonDefaultArgs(state, argc, argv)) {
diff --git a/test/testfilesystem.c b/test/testfilesystem.c
index dd4cf017bd85a..e975b19a67f0c 100644
--- a/test/testfilesystem.c
+++ b/test/testfilesystem.c
@@ -71,7 +71,7 @@ int main(int argc, char *argv[])
     }
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     /* Parse commandline */
     if (!SDLTest_CommonDefaultArgs(state, argc, argv)) {
diff --git a/test/testgeometry.c b/test/testgeometry.c
index ebfe206df5217..1d9ad1822dee6 100644
--- a/test/testgeometry.c
+++ b/test/testgeometry.c
@@ -196,7 +196,7 @@ int main(int argc, char *argv[])
     }
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     for (i = 1; i < argc;) {
         int consumed;
diff --git a/test/testgl.c b/test/testgl.c
index e70172b8ab36c..e4482dc728d90 100644
--- a/test/testgl.c
+++ b/test/testgl.c
@@ -234,7 +234,7 @@ int main(int argc, char *argv[])
     }
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     for (i = 1; i < argc;) {
         int consumed;
diff --git a/test/testgles.c b/test/testgles.c
index 45ff614b6b6b1..25829391da6a0 100644
--- a/test/testgles.c
+++ b/test/testgles.c
@@ -117,7 +117,7 @@ int main(int argc, char *argv[])
     }
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     for (i = 1; i < argc;) {
         int consumed;
diff --git a/test/testhaptic.c b/test/testhaptic.c
index e4ab85daf51ba..14a085802c753 100644
--- a/test/testhaptic.c
+++ b/test/testhaptic.c
@@ -50,7 +50,7 @@ int main(int argc, char **argv)
     }
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
     /* Parse commandline */
     for (i = 1; i < argc;) {
         int consumed;
diff --git a/test/testhittesting.c b/test/testhittesting.c
index 4de043ad16d46..3fc8b1c23192d 100644
--- a/test/testhittesting.c
+++ b/test/testhittesting.c
@@ -87,7 +87,7 @@ int main(int argc, char **argv)
     state->window_flags = SDL_WINDOW_BORDERLESS | SDL_WINDOW_RESIZABLE;
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     /* Parse commandline */
     if (!SDLTest_CommonDefaultArgs(state, argc, argv)) {
diff --git a/test/testhotplug.c b/test/testhotplug.c
index ac61ec9ea5228..adf15ab68394f 100644
--- a/test/testhotplug.c
+++ b/test/testhotplug.c
@@ -39,7 +39,7 @@ int main(int argc, char *argv[])
     }
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     /* Parse commandline */
     for (i = 1; i < argc;) {
@@ -66,7 +66,7 @@ int main(int argc, char *argv[])
     }
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1");
 
diff --git a/test/testiconv.c b/test/testiconv.c
index 8bea7f589cd8e..be6774d885bfc 100644
--- a/test/testiconv.c
+++ b/test/testiconv.c
@@ -66,7 +66,7 @@ int main(int argc, char *argv[])
     }
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     /* Parse commandline */
     for (i = 1; i < argc;) {
diff --git a/test/testime.c b/test/testime.c
index e155d479929c4..767f9be63619e 100644
--- a/test/testime.c
+++ b/test/testime.c
@@ -637,7 +637,7 @@ int main(int argc, char *argv[])
     }
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     /* Parse commandline */
     for (i = 1; i < argc;) {
diff --git a/test/testintersections.c b/test/testintersections.c
index 4dd6f95c3c9f7..bb5e69d55a8bd 100644
--- a/test/testintersections.c
+++ b/test/testintersections.c
@@ -299,7 +299,7 @@ int main(int argc, char *argv[])
     }
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     for (i = 1; i < argc;) {
         int consumed;
diff --git a/test/testkeys.c b/test/testkeys.c
index 88f75050c9a14..cfc8a96d1788c 100644
--- a/test/testkeys.c
+++ b/test/testkeys.c
@@ -30,7 +30,7 @@ int main(int argc, char *argv[])
     }
 
     /* Enable standard application logging */
-    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
+    SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
     /* Parse commandline */
     if (!SDLTest_CommonDefaultArgs(state, argc, argv)) {
diff --git a/test/testloadso.c b/test/testloadso.c
index fbd3fcc2b03de..ca89691c9ff92 100644
--- a/test/testloadso.c
+++ b/test/testloadso.c
@@ -46,7 +46,7 @@ int main(int argc, char *argv[])
     }
 
     /* Enable standard application logging */
-    SDL_LogSetPrio

(Patch may be truncated, please check the link at the top of this post.)