SDL: Remove newlines from log messages

From 718034f5fa6e796cf609db32ee8d702fc57d78aa Mon Sep 17 00:00:00 2001
From: nightmareci <[EMAIL REDACTED]>
Date: Wed, 22 Jan 2025 12:59:57 -0800
Subject: [PATCH] Remove newlines from log messages

---
 VisualC-GDK/tests/testgdk/src/testgdk.cpp     |  12 +-
 cmake/test/main_cli.c                         |   2 +-
 cmake/test/main_gui.c                         |   4 +-
 cmake/test/main_lib.c                         |   2 +-
 docs/README-migration.md                      |  12 +-
 docs/hello.c                                  |   2 +-
 src/SDL_properties.c                          |  12 +-
 src/SDL_utils.c                               |   2 +-
 src/audio/SDL_sysaudio.h                      |   2 +-
 src/audio/aaudio/SDL_aaudio.c                 |   4 +-
 src/audio/coreaudio/SDL_coreaudio.m           |   6 +-
 src/audio/disk/SDL_diskaudio.c                |   2 +-
 src/events/SDL_events.c                       |   2 +-
 src/events/SDL_keyboard.c                     |   4 +-
 src/events/SDL_mouse.c                        |   6 +-
 src/filesystem/cocoa/SDL_sysfilesystem.m      |   2 +-
 src/hidapi/android/hid.cpp                    |   2 +-
 src/joystick/android/SDL_sysjoystick.c        |   2 +-
 src/joystick/hidapi/SDL_hidapi_ps3.c          |   6 +-
 src/joystick/hidapi/SDL_hidapi_ps4.c          |  16 +-
 src/joystick/hidapi/SDL_hidapi_ps5.c          |  10 +-
 src/joystick/hidapi/SDL_hidapi_steam_hori.c   |   2 +-
 src/joystick/hidapi/SDL_hidapi_switch.c       |  14 +-
 src/joystick/hidapi/SDL_hidapi_wii.c          |   8 +-
 src/joystick/hidapi/SDL_hidapi_xbox360w.c     |   6 +-
 src/joystick/hidapi/SDL_hidapi_xboxone.c      |  34 ++---
 src/joystick/hidapi/SDL_hidapijoystick.c      |   8 +-
 src/joystick/linux/SDL_sysjoystick.c          |  58 ++++----
 src/joystick/windows/SDL_rawinputjoystick.c   |  12 +-
 src/render/direct3d11/SDL_render_d3d11.c      |   8 +-
 src/render/direct3d12/SDL_render_d3d12.c      |   6 +-
 src/render/opengl/SDL_shaders_gl.c            |   5 +-
 src/render/opengles2/SDL_render_gles2.c       |   2 +-
 src/render/vitagxm/SDL_render_vita_gxm.c      |   4 +-
 .../vitagxm/SDL_render_vita_gxm_tools.c       |  62 ++++----
 src/render/vulkan/SDL_render_vulkan.c         |   8 +-
 src/sensor/windows/SDL_windowssensor.c        |   8 +-
 src/test/SDL_test_common.c                    | 138 +++++++++---------
 src/video/SDL_egl.c                           |   2 +-
 src/video/cocoa/SDL_cocoakeyboard.m           |   2 +-
 src/video/kmsdrm/SDL_kmsdrmdyn.c              |   4 +-
 src/video/openvr/SDL_openvrvideo.c            |  10 +-
 src/video/wayland/SDL_waylanddyn.c            |   4 +-
 src/video/wayland/SDL_waylandvideo.c          |   2 +-
 src/video/windows/SDL_windowsevents.c         |  10 +-
 src/video/windows/SDL_windowsgameinput.c      |   4 +-
 src/video/windows/SDL_windowsmodes.c          |   2 +-
 src/video/windows/SDL_windowsvideo.c          |   4 +-
 src/video/x11/SDL_x11events.c                 | 102 ++++++-------
 src/video/x11/SDL_x11keyboard.c               |  16 +-
 src/video/x11/SDL_x11xinput2.c                |   2 +-
 test/checkkeys.c                              |  22 +--
 test/childprocess.c                           |   2 +-
 test/loopwave.c                               |  10 +-
 test/testatomic.c                             |  84 ++++++-----
 test/testaudiohotplug.c                       |  16 +-
 test/testaudioinfo.c                          |  60 ++++----
 test/testaudiorecording.c                     |  34 ++---
 test/testaudiostreamdynamicresample.c         |   2 +-
 test/testcamera.c                             |   4 +-
 test/testclipboard.c                          |  10 +-
 test/testcolorspace.c                         |  22 +--
 test/testcontroller.c                         |  58 ++++----
 test/testdialog.c                             |  10 +-
 test/testdisplayinfo.c                        |  16 +-
 test/testdraw.c                               |   2 +-
 test/testdrawchessboard.c                     |   6 +-
 test/testerror.c                              |  12 +-
 test/testffmpeg.c                             |  36 ++---
 test/testfile.c                               |  12 +-
 test/testfilesystem.c                         |  22 +--
 test/testgeometry.c                           |   6 +-
 test/testgl.c                                 |  64 ++++----
 test/testgles.c                               |  56 +++----
 test/testgles2.c                              |  60 ++++----
 test/testgles2_sdf.c                          |  62 ++++----
 test/testgpu_simple_clear.c                   |  10 +-
 test/testgpu_spinning_cube.c                  |   8 +-
 test/testhaptic.c                             | 103 ++++++-------
 test/testhittesting.c                         |  12 +-
 test/testhotplug.c                            |  42 +++---
 test/testiconv.c                              |   6 +-
 test/testime.c                                |  50 +++----
 test/testintersections.c                      |   6 +-
 test/testkeys.c                               |   4 +-
 test/testloadso.c                             |  18 +--
 test/testlock.c                               |  22 +--
 test/testmessage.c                            |  24 +--
 test/testmodal.c                              |   6 +-
 test/testmouse.c                              |   6 +-
 test/testmultiaudio.c                         |  10 +-
 test/testnative.c                             |  14 +-
 test/testoffscreen.c                          |  10 +-
 test/testoverlay.c                            |  28 ++--
 test/testplatform.c                           |  74 +++++-----
 test/testpower.c                              |  14 +-
 test/testqsort.c                              |   4 +-
 test/testrendercopyex.c                       |   2 +-
 test/testrendertarget.c                       |   6 +-
 test/testresample.c                           |  10 +-
 test/testrumble.c                             |  28 ++--
 test/testrwlock.c                             |  16 +-
 test/testscale.c                              |   2 +-
 test/testsem.c                                |  36 +++--
 test/testsensor.c                             |  18 +--
 test/testshader.c                             |  23 +--
 test/testshape.c                              |  14 +-
 test/testsprite.c                             |   8 +-
 test/testspriteminimal.c                      |   2 +-
 test/testspritesurface.c                      |   2 +-
 test/teststreaming.c                          |  14 +-
 test/testsurround.c                           |  16 +-
 test/testthread.c                             |  22 +--
 test/testtimer.c                              |  44 +++---
 test/testtray.c                               |  62 ++++----
 test/testurl.c                                |   2 +-
 test/testutils.c                              |   2 +-
 test/testver.c                                |   8 +-
 test/testviewport.c                           |   2 +-
 test/testvulkan.c                             |  22 +--
 test/testwm.c                                 |   8 +-
 test/testyuv.c                                |  64 ++++----
 test/torturethread.c                          |  10 +-
 123 files changed, 1143 insertions(+), 1118 deletions(-)

diff --git a/VisualC-GDK/tests/testgdk/src/testgdk.cpp b/VisualC-GDK/tests/testgdk/src/testgdk.cpp
index d2a92091ee8f0..51fc75bc08cc5 100644
--- a/VisualC-GDK/tests/testgdk/src/testgdk.cpp
+++ b/VisualC-GDK/tests/testgdk/src/testgdk.cpp
@@ -198,7 +198,7 @@ LoadSprite(const char *file)
             return -1;
         }
         if (!SDL_SetTextureBlendMode(sprites[i], blendMode)) {
-            SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set blend mode: %s\n", SDL_GetError());
+            SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set blend mode: %s", SDL_GetError());
             SDL_DestroyTexture(sprites[i]);
             return -1;
         }
@@ -405,7 +405,7 @@ main(int argc, char *argv[])
     sprites =
         (SDL_Texture **) SDL_malloc(state->num_windows * sizeof(*sprites));
     if (!sprites) {
-        SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!\n");
+        SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!");
         quit(2);
     }
     for (i = 0; i < state->num_windows; ++i) {
@@ -420,13 +420,13 @@ main(int argc, char *argv[])
     soundname = GetResourceFilename(argc > 1 ? argv[1] : NULL, "sample.wav");
 
     if (!soundname) {
-        SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "%s\n", SDL_GetError());
+        SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "%s", SDL_GetError());
         quit(1);
     }
 
     /* Load the wave file into memory */
     if (!SDL_LoadWAV(soundname, &wave.spec, &wave.sound, &wave.soundlen)) {
-        SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s\n", soundname, SDL_GetError());
+        SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s", soundname, SDL_GetError());
         quit(1);
     }
 
@@ -436,11 +436,11 @@ main(int argc, char *argv[])
         SDL_Log("%i: %s", i, SDL_GetAudioDriver(i));
     }
 
-    SDL_Log("Using audio driver: %s\n", SDL_GetCurrentAudioDriver());
+    SDL_Log("Using audio driver: %s", SDL_GetCurrentAudioDriver());
 
     stream = SDL_OpenAudioDeviceStream(SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &wave.spec, NULL, NULL);
     if (!stream) {
-        SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create audio stream: %s\n", SDL_GetError());
+        SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create audio stream: %s", SDL_GetError());
         return -1;
     }
     SDL_ResumeAudioDevice(SDL_GetAudioStreamDevice(stream));
diff --git a/cmake/test/main_cli.c b/cmake/test/main_cli.c
index 5a1c0c62537f7..39c5ce2758c0f 100644
--- a/cmake/test/main_cli.c
+++ b/cmake/test/main_cli.c
@@ -6,7 +6,7 @@ int main(int argc, char *argv[])
 {
     SDL_SetMainReady();
     if (!SDL_Init(0)) {
-        SDL_Log("Could not initialize SDL: %s\n", SDL_GetError());
+        SDL_Log("Could not initialize SDL: %s", SDL_GetError());
         return 1;
     }
     SDL_Delay(100);
diff --git a/cmake/test/main_gui.c b/cmake/test/main_gui.c
index 3df64e5fd0492..18ed10107c417 100644
--- a/cmake/test/main_gui.c
+++ b/cmake/test/main_gui.c
@@ -6,12 +6,12 @@ int main(int argc, char *argv[])
     SDL_Window *window = NULL;
     SDL_Surface *screenSurface = NULL;
     if (!SDL_Init(SDL_INIT_VIDEO)) {
-        SDL_Log("Could not initialize SDL: %s\n", SDL_GetError());
+        SDL_Log("Could not initialize SDL: %s", SDL_GetError());
         return 1;
     }
     window = SDL_CreateWindow("Hello SDL", 640, 480, 0);
     if (!window) {
-        SDL_Log("could not create window: %s\n", SDL_GetError());
+        SDL_Log("could not create window: %s", SDL_GetError());
         return 1;
     }
     screenSurface = SDL_GetWindowSurface(window);
diff --git a/cmake/test/main_lib.c b/cmake/test/main_lib.c
index a59150b4a69cf..6aec1f637458a 100644
--- a/cmake/test/main_lib.c
+++ b/cmake/test/main_lib.c
@@ -18,7 +18,7 @@ int MYLIBRARY_EXPORT mylibrary_work(void);
 int mylibrary_init(void) {
     SDL_SetMainReady();
     if (!SDL_Init(0)) {
-        SDL_Log("Could not initialize SDL: %s\n", SDL_GetError());
+        SDL_Log("Could not initialize SDL: %s", SDL_GetError());
         return 1;
     }
     return 0;
diff --git a/docs/README-migration.md b/docs/README-migration.md
index 84bf315b41d5a..750a1f05447e0 100644
--- a/docs/README-migration.md
+++ b/docs/README-migration.md
@@ -193,7 +193,7 @@ Rather than iterating over audio devices using a device index, there are new fun
         if (devices) {
             for (i = 0; i < num_devices; ++i) {
                 SDL_AudioDeviceID instance_id = devices[i];
-                SDL_Log("AudioDevice %" SDL_PRIu32 ": %s\n", instance_id, SDL_GetAudioDeviceName(instance_id));
+                SDL_Log("AudioDevice %" SDL_PRIu32 ": %s", instance_id, SDL_GetAudioDeviceName(instance_id));
             }
             SDL_free(devices);
         }
@@ -749,7 +749,7 @@ Rather than iterating over haptic devices using device index, there is a new fun
         if (haptics) {
             for (i = 0; i < num_haptics; ++i) {
                 SDL_HapticID instance_id = haptics[i];
-                SDL_Log("Haptic %" SDL_PRIu32 ": %s\n", instance_id, SDL_GetHapticNameForID(instance_id));
+                SDL_Log("Haptic %" SDL_PRIu32 ": %s", instance_id, SDL_GetHapticNameForID(instance_id));
             }
             SDL_free(haptics);
         }
@@ -917,7 +917,7 @@ Rather than iterating over joysticks using device index, there is a new function
                 const char *name = SDL_GetJoystickNameForID(instance_id);
                 const char *path = SDL_GetJoystickPathForID(instance_id);
 
-                SDL_Log("Joystick %" SDL_PRIu32 ": %s%s%s VID 0x%.4x, PID 0x%.4x\n",
+                SDL_Log("Joystick %" SDL_PRIu32 ": %s%s%s VID 0x%.4x, PID 0x%.4x",
                         instance_id, name ? name : "Unknown", path ? ", " : "", path ? path : "", SDL_GetJoystickVendorForID(instance_id), SDL_GetJoystickProductForID(instance_id));
             }
             SDL_free(joysticks);
@@ -1696,7 +1696,7 @@ Rather than iterating over sensors using device index, there is a new function S
         SDL_SensorID *sensors = SDL_GetSensors(&num_sensors);
         if (sensors) {
             for (i = 0; i < num_sensors; ++i) {
-                SDL_Log("Sensor %" SDL_PRIu32 ": %s, type %d, platform type %d\n",
+                SDL_Log("Sensor %" SDL_PRIu32 ": %s, type %d, platform type %d",
                         sensors[i],
                         SDL_GetSensorNameForID(sensors[i]),
                         SDL_GetSensorTypeForID(sensors[i]),
@@ -2121,7 +2121,7 @@ Rather than iterating over displays using display index, there is a new function
                 SDL_DisplayID instance_id = displays[i];
                 const char *name = SDL_GetDisplayName(instance_id);
 
-                SDL_Log("Display %" SDL_PRIu32 ": %s\n", instance_id, name ? name : "Unknown");
+                SDL_Log("Display %" SDL_PRIu32 ": %s", instance_id, name ? name : "Unknown");
             }
             SDL_free(displays);
         }
@@ -2167,7 +2167,7 @@ Rather than iterating over display modes using an index, there is a new function
     if (modes) {
         for (i = 0; i < num_modes; ++i) {
             SDL_DisplayMode *mode = modes[i];
-            SDL_Log("Display %" SDL_PRIu32 " mode %d: %dx%d@%gx %gHz\n",
+            SDL_Log("Display %" SDL_PRIu32 " mode %d: %dx%d@%gx %gHz",
                     display, i, mode->w, mode->h, mode->pixel_density, mode->refresh_rate);
         }
         SDL_free(modes);
diff --git a/docs/hello.c b/docs/hello.c
index 74a04bc246aa1..a825ea1c432f5 100644
--- a/docs/hello.c
+++ b/docs/hello.c
@@ -21,7 +21,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
 {
     /* Create the window */
     if (!SDL_CreateWindowAndRenderer("Hello World", 800, 600, SDL_WINDOW_FULLSCREEN, &window, &renderer)) {
-        SDL_Log("Couldn't create window and renderer: %s\n", SDL_GetError());
+        SDL_Log("Couldn't create window and renderer: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
     return SDL_APP_CONTINUE;
diff --git a/src/SDL_properties.c b/src/SDL_properties.c
index 9dc10a675c811..41c81e9e592ee 100644
--- a/src/SDL_properties.c
+++ b/src/SDL_properties.c
@@ -766,25 +766,25 @@ static void SDLCALL SDL_DumpPropertiesCallback(void *userdata, SDL_PropertiesID
 {
     switch (SDL_GetPropertyType(props, name)) {
     case SDL_PROPERTY_TYPE_POINTER:
-        SDL_Log("%s: %p\n", name, SDL_GetPointerProperty(props, name, NULL));
+        SDL_Log("%s: %p", name, SDL_GetPointerProperty(props, name, NULL));
         break;
     case SDL_PROPERTY_TYPE_STRING:
-        SDL_Log("%s: \"%s\"\n", name, SDL_GetStringProperty(props, name, ""));
+        SDL_Log("%s: \"%s\"", name, SDL_GetStringProperty(props, name, ""));
         break;
     case SDL_PROPERTY_TYPE_NUMBER:
         {
             Sint64 value = SDL_GetNumberProperty(props, name, 0);
-            SDL_Log("%s: %" SDL_PRIs64 " (%" SDL_PRIx64 ")\n", name, value, value);
+            SDL_Log("%s: %" SDL_PRIs64 " (%" SDL_PRIx64 ")", name, value, value);
         }
         break;
     case SDL_PROPERTY_TYPE_FLOAT:
-        SDL_Log("%s: %g\n", name, SDL_GetFloatProperty(props, name, 0.0f));
+        SDL_Log("%s: %g", name, SDL_GetFloatProperty(props, name, 0.0f));
         break;
     case SDL_PROPERTY_TYPE_BOOLEAN:
-        SDL_Log("%s: %s\n", name, SDL_GetBooleanProperty(props, name, false) ? "true" : "false");
+        SDL_Log("%s: %s", name, SDL_GetBooleanProperty(props, name, false) ? "true" : "false");
         break;
     default:
-        SDL_Log("%s UNKNOWN TYPE\n", name);
+        SDL_Log("%s UNKNOWN TYPE", name);
         break;
     }
 }
diff --git a/src/SDL_utils.c b/src/SDL_utils.c
index a877360f6218d..fb82aac14beb6 100644
--- a/src/SDL_utils.c
+++ b/src/SDL_utils.c
@@ -240,7 +240,7 @@ void SDL_SetObjectsInvalid(void)
                 type = "unknown object";
                 break;
             }
-            SDL_Log("Leaked %s (%p)\n", type, object);
+            SDL_Log("Leaked %s (%p)", type, object);
         }
         SDL_assert(SDL_HashTableEmpty(SDL_objects));
 
diff --git a/src/audio/SDL_sysaudio.h b/src/audio/SDL_sysaudio.h
index c5cce0e4c6db2..c8af24412a810 100644
--- a/src/audio/SDL_sysaudio.h
+++ b/src/audio/SDL_sysaudio.h
@@ -28,7 +28,7 @@
 #define DEBUG_AUDIO_CONVERT 0
 
 #if DEBUG_AUDIO_CONVERT
-#define LOG_DEBUG_AUDIO_CONVERT(from, to) SDL_Log("SDL_AUDIO_CONVERT: Converting %s to %s.\n", from, to);
+#define LOG_DEBUG_AUDIO_CONVERT(from, to) SDL_Log("SDL_AUDIO_CONVERT: Converting %s to %s.", from, to);
 #else
 #define LOG_DEBUG_AUDIO_CONVERT(from, to)
 #endif
diff --git a/src/audio/aaudio/SDL_aaudio.c b/src/audio/aaudio/SDL_aaudio.c
index fd075b53af847..8b1681b4e1086 100644
--- a/src/audio/aaudio/SDL_aaudio.c
+++ b/src/audio/aaudio/SDL_aaudio.c
@@ -315,10 +315,10 @@ static bool BuildAAudioStream(SDL_AudioDevice *device)
     ctx.AAudioStreamBuilder_setDataCallback(builder, AAUDIO_dataCallback, device);
     // Some devices have flat sounding audio when low latency mode is enabled, but this is a better experience for most people
     if (SDL_GetHintBoolean(SDL_HINT_ANDROID_LOW_LATENCY_AUDIO, true)) {
-        SDL_Log("Low latency audio enabled\n");
+        SDL_Log("Low latency audio enabled");
         ctx.AAudioStreamBuilder_setPerformanceMode(builder, AAUDIO_PERFORMANCE_MODE_LOW_LATENCY);
     } else {
-        SDL_Log("Low latency audio disabled\n");
+        SDL_Log("Low latency audio disabled");
     }
 
     LOGI("AAudio Try to open %u hz %s %u channels samples %u",
diff --git a/src/audio/coreaudio/SDL_coreaudio.m b/src/audio/coreaudio/SDL_coreaudio.m
index cfa0616da1800..cd0446eb730f6 100644
--- a/src/audio/coreaudio/SDL_coreaudio.m
+++ b/src/audio/coreaudio/SDL_coreaudio.m
@@ -31,7 +31,7 @@
 #if DEBUG_COREAUDIO
     #define CHECK_RESULT(msg) \
         if (result != noErr) { \
-            SDL_Log("COREAUDIO: Got error %d from '%s'!\n", (int)result, msg); \
+            SDL_Log("COREAUDIO: Got error %d from '%s'!", (int)result, msg); \
             return SDL_SetError("CoreAudio error (%s): %d", msg, (int)result); \
         }
 #else
@@ -224,7 +224,7 @@ static void RefreshPhysicalDevices(void)
                 name[len] = '\0';
 
                 #if DEBUG_COREAUDIO
-                SDL_Log("COREAUDIO: Found %s device #%d: '%s' (devid %d)\n", ((recording) ? "recording" : "playback"), (int)i, name, (int)dev);
+                SDL_Log("COREAUDIO: Found %s device #%d: '%s' (devid %d)", ((recording) ? "recording" : "playback"), (int)i, name, (int)dev);
                 #endif
                 SDLCoreAudioHandle *newhandle = (SDLCoreAudioHandle *) SDL_calloc(1, sizeof (*newhandle));
                 if (newhandle) {
@@ -834,7 +834,7 @@ static bool PrepareAudioQueue(SDL_AudioDevice *device)
     }
 
     #if DEBUG_COREAUDIO
-    SDL_Log("COREAUDIO: numAudioBuffers == %d\n", numAudioBuffers);
+    SDL_Log("COREAUDIO: numAudioBuffers == %d", numAudioBuffers);
     #endif
 
     for (int i = 0; i < numAudioBuffers; i++) {
diff --git a/src/audio/disk/SDL_diskaudio.c b/src/audio/disk/SDL_diskaudio.c
index c59bd2ec608bd..99145c90dbd9b 100644
--- a/src/audio/disk/SDL_diskaudio.c
+++ b/src/audio/disk/SDL_diskaudio.c
@@ -136,7 +136,7 @@ static bool DISKAUDIO_OpenDevice(SDL_AudioDevice *device)
     }
 
     SDL_LogCritical(SDL_LOG_CATEGORY_AUDIO, "You are using the SDL disk i/o audio driver!");
-    SDL_LogCritical(SDL_LOG_CATEGORY_AUDIO, " %s file [%s].\n", recording ? "Reading from" : "Writing to", fname);
+    SDL_LogCritical(SDL_LOG_CATEGORY_AUDIO, " %s file [%s].", recording ? "Reading from" : "Writing to", fname);
 
     return true;  // We're ready to rock and roll. :-)
 }
diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c
index ca11afffa36af..7404234380e01 100644
--- a/src/events/SDL_events.c
+++ b/src/events/SDL_events.c
@@ -847,7 +847,7 @@ void SDL_StopEventLoop(void)
     SDL_EventQ.active = false;
 
     if (report && SDL_atoi(report)) {
-        SDL_Log("SDL EVENT QUEUE: Maximum events in-flight: %d\n",
+        SDL_Log("SDL EVENT QUEUE: Maximum events in-flight: %d",
                 SDL_EventQ.max_events_seen);
     }
 
diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c
index e4664fba6d296..066c6e6aaa6ed 100644
--- a/src/events/SDL_keyboard.c
+++ b/src/events/SDL_keyboard.c
@@ -220,7 +220,7 @@ void SDL_ResetKeyboard(void)
     int scancode;
 
 #ifdef DEBUG_KEYBOARD
-    SDL_Log("Resetting keyboard\n");
+    SDL_Log("Resetting keyboard");
 #endif
     for (scancode = SDL_SCANCODE_UNKNOWN; scancode < SDL_SCANCODE_COUNT; ++scancode) {
         if (keyboard->keystate[scancode]) {
@@ -517,7 +517,7 @@ static bool SDL_SendKeyboardKeyInternal(Uint64 timestamp, Uint32 flags, SDL_Keyb
     const Uint8 source = flags & KEYBOARD_SOURCE_MASK;
 
 #ifdef DEBUG_KEYBOARD
-    SDL_Log("The '%s' key has been %s\n", SDL_GetScancodeName(scancode), down ? "pressed" : "released");
+    SDL_Log("The '%s' key has been %s", SDL_GetScancodeName(scancode), down ? "pressed" : "released");
 #endif
 
     // Figure out what type of event this is
diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c
index df89271531ce9..25dfef7f2a7f9 100644
--- a/src/events/SDL_mouse.c
+++ b/src/events/SDL_mouse.c
@@ -605,7 +605,7 @@ static bool SDL_UpdateMouseFocus(SDL_Window *window, float x, float y, Uint32 bu
     if (!inWindow) {
         if (window == mouse->focus) {
 #ifdef DEBUG_MOUSE
-            SDL_Log("Mouse left window, synthesizing move & focus lost event\n");
+            SDL_Log("Mouse left window, synthesizing move & focus lost event");
 #endif
             if (send_mouse_motion) {
                 SDL_PrivateSendMouseMotion(0, window, SDL_GLOBAL_MOUSE_ID, false, x, y);
@@ -617,7 +617,7 @@ static bool SDL_UpdateMouseFocus(SDL_Window *window, float x, float y, Uint32 bu
 
     if (window != mouse->focus) {
 #ifdef DEBUG_MOUSE
-        SDL_Log("Mouse entered window, synthesizing focus gain & move event\n");
+        SDL_Log("Mouse entered window, synthesizing focus gain & move event");
 #endif
         SDL_SetMouseFocus(window);
         if (send_mouse_motion) {
@@ -740,7 +740,7 @@ static void SDL_PrivateSendMouseMotion(Uint64 timestamp, SDL_Window *window, SDL
 
     if (mouse->has_position && xrel == 0.0f && yrel == 0.0f) { // Drop events that don't change state
 #ifdef DEBUG_MOUSE
-        SDL_Log("Mouse event didn't change state - dropped!\n");
+        SDL_Log("Mouse event didn't change state - dropped!");
 #endif
         return;
     }
diff --git a/src/filesystem/cocoa/SDL_sysfilesystem.m b/src/filesystem/cocoa/SDL_sysfilesystem.m
index a5fa67bcdf768..5818764e55a8c 100644
--- a/src/filesystem/cocoa/SDL_sysfilesystem.m
+++ b/src/filesystem/cocoa/SDL_sysfilesystem.m
@@ -92,7 +92,7 @@
             static bool shown = false;
             if (!shown) {
                 shown = true;
-                SDL_LogCritical(SDL_LOG_CATEGORY_SYSTEM, "tvOS does not have persistent local storage! Use iCloud storage if you want your data to persist between sessions.\n");
+                SDL_LogCritical(SDL_LOG_CATEGORY_SYSTEM, "tvOS does not have persistent local storage! Use iCloud storage if you want your data to persist between sessions.");
             }
         }
 
diff --git a/src/hidapi/android/hid.cpp b/src/hidapi/android/hid.cpp
index 1e43aa73f1d12..887390ed57e81 100644
--- a/src/hidapi/android/hid.cpp
+++ b/src/hidapi/android/hid.cpp
@@ -1028,7 +1028,7 @@ extern "C"
 
 static void SDLCALL RequestBluetoothPermissionCallback( void *userdata, const char *permission, bool granted )
 {
-	SDL_Log( "Bluetooth permission %s\n", granted ? "granted" : "denied" );
+	SDL_Log( "Bluetooth permission %s", granted ? "granted" : "denied" );
 
 	if ( granted && g_HIDDeviceManagerCallbackHandler )
 	{
diff --git a/src/joystick/android/SDL_sysjoystick.c b/src/joystick/android/SDL_sysjoystick.c
index 95ad99c0a2807..9a3402eb6af51 100644
--- a/src/joystick/android/SDL_sysjoystick.c
+++ b/src/joystick/android/SDL_sysjoystick.c
@@ -329,7 +329,7 @@ void Android_AddJoystick(int device_id, const char *name, const char *desc, int
     }
 
 #ifdef DEBUG_JOYSTICK
-    SDL_Log("Joystick: %s, descriptor %s, vendor = 0x%.4x, product = 0x%.4x, %d axes, %d hats\n", name, desc, vendor_id, product_id, naxes, nhats);
+    SDL_Log("Joystick: %s, descriptor %s, vendor = 0x%.4x, product = 0x%.4x, %d axes, %d hats", name, desc, vendor_id, product_id, naxes, nhats);
 #endif
 
     if (nhats > 0) {
diff --git a/src/joystick/hidapi/SDL_hidapi_ps3.c b/src/joystick/hidapi/SDL_hidapi_ps3.c
index bcb7d5b98e76a..6c82647c0bcd0 100644
--- a/src/joystick/hidapi/SDL_hidapi_ps3.c
+++ b/src/joystick/hidapi/SDL_hidapi_ps3.c
@@ -566,7 +566,7 @@ static bool HIDAPI_DriverPS3_UpdateDevice(SDL_HIDAPI_Device *device)
             break;
         default:
 #ifdef DEBUG_JOYSTICK
-            SDL_Log("Unknown PS3 packet: 0x%.2x\n", data[0]);
+            SDL_Log("Unknown PS3 packet: 0x%.2x", data[0]);
 #endif
             break;
         }
@@ -1004,7 +1004,7 @@ static bool HIDAPI_DriverPS3ThirdParty_UpdateDevice(SDL_HIDAPI_Device *device)
             HIDAPI_DriverPS3ThirdParty_HandleStatePacket18(joystick, ctx, data, size);
         } else {
 #ifdef DEBUG_JOYSTICK
-            SDL_Log("Unknown PS3 packet, size %d\n", size);
+            SDL_Log("Unknown PS3 packet, size %d", size);
 #endif
         }
     }
@@ -1357,7 +1357,7 @@ static bool HIDAPI_DriverPS3SonySixaxis_UpdateDevice(SDL_HIDAPI_Device *device)
         break;
     default:
 #ifdef DEBUG_JOYSTICK
-        SDL_Log("Unknown PS3 packet: 0x%.2x\n", data[0]);
+        SDL_Log("Unknown PS3 packet: 0x%.2x", data[0]);
 #endif
         break;
     }
diff --git a/src/joystick/hidapi/SDL_hidapi_ps4.c b/src/joystick/hidapi/SDL_hidapi_ps4.c
index 4fe7b03d77ed6..7404bf22687dc 100644
--- a/src/joystick/hidapi/SDL_hidapi_ps4.c
+++ b/src/joystick/hidapi/SDL_hidapi_ps4.c
@@ -323,7 +323,7 @@ static bool HIDAPI_DriverPS4_InitDevice(SDL_HIDAPI_Device *device)
             if (size > 0) {
                 HIDAPI_DumpPacket("PS4 first packet: size = %d", data, size);
             } else {
-                SDL_Log("PS4 first packet: size = %d\n", size);
+                SDL_Log("PS4 first packet: size = %d", size);
             }
 #endif
             if (size > 0 &&
@@ -468,7 +468,7 @@ static bool HIDAPI_DriverPS4_LoadOfficialCalibrationData(SDL_HIDAPI_Device *devi
 
     if (!ctx->official_controller) {
 #ifdef DEBUG_PS4_CALIBRATION
-        SDL_Log("Not an official controller, ignoring calibration\n");
+        SDL_Log("Not an official controller, ignoring calibration");
 #endif
         return false;
     }
@@ -478,7 +478,7 @@ static bool HIDAPI_DriverPS4_LoadOfficialCalibrationData(SDL_HIDAPI_Device *devi
         size = ReadFeatureReport(device->dev, k_ePS4FeatureReportIdGyroCalibration_USB, data, sizeof(data));
         if (size < 35) {
 #ifdef DEBUG_PS4_CALIBRATION
-            SDL_Log("Short read of calibration data: %d, ignoring calibration\n", size);
+            SDL_Log("Short read of calibration data: %d, ignoring calibration", size);
 #endif
             return false;
         }
@@ -487,7 +487,7 @@ static bool HIDAPI_DriverPS4_LoadOfficialCalibrationData(SDL_HIDAPI_Device *devi
             size = ReadFeatureReport(device->dev, k_ePS4FeatureReportIdGyroCalibration_BT, data, sizeof(data));
             if (size < 35) {
 #ifdef DEBUG_PS4_CALIBRATION
-                SDL_Log("Short read of calibration data: %d, ignoring calibration\n", size);
+                SDL_Log("Short read of calibration data: %d, ignoring calibration", size);
 #endif
                 return false;
             }
@@ -590,19 +590,19 @@ static bool HIDAPI_DriverPS4_LoadOfficialCalibrationData(SDL_HIDAPI_Device *devi
         ctx->hardware_calibration = true;
         for (i = 0; i < 6; ++i) {
 #ifdef DEBUG_PS4_CALIBRATION
-            SDL_Log("calibration[%d] bias = %d, sensitivity = %f\n", i, ctx->calibration[i].bias, ctx->calibration[i].scale);
+            SDL_Log("calibration[%d] bias = %d, sensitivity = %f", i, ctx->calibration[i].bias, ctx->calibration[i].scale);
 #endif
             // Some controllers have a bad calibration
             if (SDL_abs(ctx->calibration[i].bias) > 1024 || SDL_fabsf(1.0f - ctx->calibration[i].scale) > 0.5f) {
 #ifdef DEBUG_PS4_CALIBRATION
-                SDL_Log("invalid calibration, ignoring\n");
+                SDL_Log("invalid calibration, ignoring");
 #endif
                 ctx->hardware_calibration = false;
             }
         }
     } else {
 #ifdef DEBUG_PS4_CALIBRATION
-        SDL_Log("Calibration data not available\n");
+        SDL_Log("Calibration data not available");
 #endif
     }
     return ctx->hardware_calibration;
@@ -1291,7 +1291,7 @@ static bool HIDAPI_DriverPS4_UpdateDevice(SDL_HIDAPI_Device *device)
             break;
         default:
 #ifdef DEBUG_JOYSTICK
-            SDL_Log("Unknown PS4 packet: 0x%.2x\n", data[0]);
+            SDL_Log("Unknown PS4 packet: 0x%.2x", data[0]);
 #endif
             break;
         }
diff --git a/src/joystick/hidapi/SDL_hidapi_ps5.c b/src/joystick/hidapi/SDL_hidapi_ps5.c
index 7226fa2092331..94b720d4246a7 100644
--- a/src/joystick/hidapi/SDL_hidapi_ps5.c
+++ b/src/joystick/hidapi/SDL_hidapi_ps5.c
@@ -402,7 +402,7 @@ static bool HIDAPI_DriverPS5_InitDevice(SDL_HIDAPI_Device *device)
     if (size > 0) {
         HIDAPI_DumpPacket("PS5 first packet: size = %d", data, size);
     } else {
-        SDL_Log("PS5 first packet: size = %d\n", size);
+        SDL_Log("PS5 first packet: size = %d", size);
     }
 #endif
     if (size == 64) {
@@ -561,7 +561,7 @@ static void HIDAPI_DriverPS5_LoadCalibrationData(SDL_HIDAPI_Device *device)
     size = ReadFeatureReport(device->dev, k_EPS5FeatureReportIdCalibration, data, sizeof(data));
     if (size < 35) {
 #ifdef DEBUG_PS5_CALIBRATION
-        SDL_Log("Short read of calibration data: %d, ignoring calibration\n", size);
+        SDL_Log("Short read of calibration data: %d, ignoring calibration", size);
 #endif
         return;
     }
@@ -631,12 +631,12 @@ static void HIDAPI_DriverPS5_LoadCalibrationData(SDL_HIDAPI_Device *device)
         for (i = 0; i < 6; ++i) {
             float divisor = (i < 3 ? 64.0f : 1.0f);
 #ifdef DEBUG_PS5_CALIBRATION
-            SDL_Log("calibration[%d] bias = %d, sensitivity = %f\n", i, ctx->calibration[i].bias, ctx->calibration[i].sensitivity);
+            SDL_Log("cal

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