Deprecate string format log shorthand.

This commit is contained in:
Matthias Mailänder
2023-05-04 17:44:46 +02:00
committed by abcdefg30
parent e251126dd4
commit 1c2ce0dcc0
27 changed files with 100 additions and 84 deletions

View File

@@ -29,7 +29,8 @@ namespace OpenRA.Platforms.Default
}
catch (InvalidOperationException e)
{
Log.Write("sound", "Failed to initialize OpenAL device. Error was {0}", e);
Log.Write("sound", "Failed to initialize OpenAL device. Error was");
Log.Write("sound", e);
return new DummySoundEngine();
}
}

View File

@@ -65,7 +65,7 @@ namespace OpenRA.Platforms.Default
var devicesPtr = ALC10.alcGetString(IntPtr.Zero, type);
if (devicesPtr == IntPtr.Zero || AL10.alGetError() != AL10.AL_NO_ERROR)
{
Log.Write("sound", "Failed to query OpenAL device list using {0}", label);
Log.Write("sound", $"Failed to query OpenAL device list using {label}");
return Array.Empty<string>();
}
@@ -140,7 +140,7 @@ namespace OpenRA.Platforms.Default
AL10.alGenSources(1, out var source);
if (AL10.alGetError() != AL10.AL_NO_ERROR)
{
Log.Write("sound", "Failed generating OpenAL source {0}", i);
Log.Write("sound", $"Failed generating OpenAL source {i}");
return;
}

View File

@@ -716,7 +716,7 @@ namespace OpenRA.Platforms.Default
Log.Write("graphics", "");
Log.Write("graphics", "OpenGL Information:");
var vendor = glGetString(GL_VENDOR);
Log.Write("graphics", "Vendor: {0}", vendor);
Log.Write("graphics", $"Vendor: {vendor}");
if (vendor.Contains("Microsoft"))
{
var msg = "";
@@ -725,9 +725,9 @@ namespace OpenRA.Platforms.Default
Log.Write("graphics", msg);
}
Log.Write("graphics", "Renderer: {0}", glGetString(GL_RENDERER));
Log.Write("graphics", "GL Version: {0}", glGetString(GL_VERSION));
Log.Write("graphics", "Shader Version: {0}", glGetString(GL_SHADING_LANGUAGE_VERSION));
Log.Write("graphics", $"Renderer: {glGetString(GL_RENDERER)}");
Log.Write("graphics", $"GL Version: {glGetString(GL_VERSION)}");
Log.Write("graphics", $"Shader Version: {glGetString(GL_SHADING_LANGUAGE_VERSION)}");
Log.Write("graphics", "Available extensions:");
if (Profile != GLProfile.Legacy)

View File

@@ -59,7 +59,7 @@ namespace OpenRA.Platforms.Default
var log = new StringBuilder(len);
OpenGL.glGetShaderInfoLog(shader, len, out _, log);
Log.Write("graphics", "GL Info Log:\n{0}", log.ToString());
Log.Write("graphics", $"GL Info Log:\n{log}");
throw new InvalidProgramException($"Compile error in shader object '{filename}'");
}
@@ -105,7 +105,7 @@ namespace OpenRA.Platforms.Default
var log = new StringBuilder(len);
OpenGL.glGetProgramInfoLog(program, len, out _, log);
Log.Write("graphics", "GL Info Log:\n{0}", log.ToString());
Log.Write("graphics", $"GL Info Log:\n{log}");
throw new InvalidProgramException($"Link error in shader program '{name}'");
}