qol: interpolated strings
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user