qol: interpolated strings

This commit is contained in:
Gary Sharp
2025-07-20 11:56:34 +10:00
parent 4e518d6684
commit 7faebe56a8
108 changed files with 342 additions and 350 deletions
+3 -3
View File
@@ -158,7 +158,7 @@ namespace Disco.Services.Logging
{
Directory.CreateDirectory(logDirectory);
}
var logFileName = string.Format("DiscoLog_{0:yyy-MM-dd}.sdf", Date);
var logFileName = $"DiscoLog_{Date:yyy-MM-dd}.sdf";
return Path.Combine(logDirectory, logFileName);
}
@@ -286,10 +286,10 @@ namespace Disco.Services.Logging
}
}
else
throw new InvalidOperationException(string.Format("Unknown Log Event Type Called: {0} (for Module: {1})", EventTypeId, ModuleId));
throw new InvalidOperationException($"Unknown Log Event Type Called: {EventTypeId} (for Module: {ModuleId})");
}
else
throw new InvalidOperationException(string.Format("Unknown Log Module Called: {0}", ModuleId));
throw new InvalidOperationException($"Unknown Log Module Called: {ModuleId}");
}
}
@@ -57,7 +57,7 @@ namespace Disco.Services.Logging
var module = LogContext.LogModules.Values.FirstOrDefault(m => m.ModuleName.Equals(name, StringComparison.OrdinalIgnoreCase));
if (module == null)
throw new ArgumentException(string.Format("Invalid Module Name specified: {0}", name), "ModuleNames");
throw new ArgumentException($"Invalid Module Name specified: {name}", "ModuleNames");
yield return NotificationsModulePrefix + module.ModuleName;
}
+2 -2
View File
@@ -171,7 +171,7 @@ namespace Disco.Services.Logging
public static void CompressDirectory(string DirectoryPath)
{
if (DirectoryPath.Length > 250)
throw new InvalidOperationException(string.Format("Directory Path to Long (>250) to Compress: {0}", DirectoryPath));
throw new InvalidOperationException($"Directory Path to Long (>250) to Compress: {DirectoryPath}");
DirectoryInfo dirInfo = new DirectoryInfo(DirectoryPath);
if (dirInfo.Exists)
@@ -192,7 +192,7 @@ namespace Disco.Services.Logging
}
else
{
throw new InvalidOperationException(string.Format("Directory doesn't exist: {0}", DirectoryPath));
throw new InvalidOperationException($"Directory doesn't exist: {DirectoryPath}");
}
}