mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-16 08:25:28 +00:00
Use string interpolation wherever possible
Majority of cases still need to go through string.Format() due to localization requirements
This commit is contained in:
@@ -138,16 +138,16 @@ namespace ArchiSteamFarm.NLog {
|
||||
}
|
||||
|
||||
if (((chatGroupID == 0) || (chatID == 0)) && (steamID == 0)) {
|
||||
throw new InvalidOperationException("((" + nameof(chatGroupID) + " || " + nameof(chatID) + ") && " + nameof(steamID) + ")");
|
||||
throw new InvalidOperationException($"(({nameof(chatGroupID)} || {nameof(chatID)}) && {nameof(steamID)})");
|
||||
}
|
||||
|
||||
StringBuilder loggedMessage = new(previousMethodName + "() " + message + " " + (echo ? "->" : "<-") + " ");
|
||||
StringBuilder loggedMessage = new($"{previousMethodName}() {message} {(echo ? "->" : "<-")} ");
|
||||
|
||||
if ((chatGroupID != 0) && (chatID != 0)) {
|
||||
loggedMessage.Append(chatGroupID + "-" + chatID);
|
||||
loggedMessage.Append($"{chatGroupID}-{chatID}");
|
||||
|
||||
if (steamID != 0) {
|
||||
loggedMessage.Append("/" + steamID);
|
||||
loggedMessage.Append($"/{steamID}");
|
||||
}
|
||||
} else if (steamID != 0) {
|
||||
loggedMessage.Append(steamID);
|
||||
@@ -225,7 +225,7 @@ namespace ArchiSteamFarm.NLog {
|
||||
|
||||
ulong steamID64 = steamID;
|
||||
|
||||
string loggedMessage = previousMethodName + "() " + steamID.AccountType + " " + steamID64 + (handled.HasValue ? " = " + handled.Value : "");
|
||||
string loggedMessage = $"{previousMethodName}() {steamID.AccountType} {steamID64}{(handled.HasValue ? $" = {handled.Value}" : "")}";
|
||||
|
||||
LogEventInfo logEventInfo = new(LogLevel.Trace, Logger.Name, loggedMessage) {
|
||||
Properties = {
|
||||
|
||||
@@ -322,7 +322,7 @@ namespace ArchiSteamFarm.NLog {
|
||||
OnUserInputStart();
|
||||
|
||||
try {
|
||||
Console.Write(@">> " + Strings.EnterCommand);
|
||||
Console.Write($@">> {Strings.EnterCommand}");
|
||||
string? command = ConsoleReadLine();
|
||||
|
||||
if (string.IsNullOrEmpty(command)) {
|
||||
@@ -347,12 +347,12 @@ namespace ArchiSteamFarm.NLog {
|
||||
Bot? targetBot = Bot.Bots?.OrderBy(bot => bot.Key, Bot.BotsComparer).Select(bot => bot.Value).FirstOrDefault();
|
||||
|
||||
if (targetBot == null) {
|
||||
Console.WriteLine(@"<< " + Strings.ErrorNoBotsDefined);
|
||||
Console.WriteLine($@"<< {Strings.ErrorNoBotsDefined}");
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
Console.WriteLine(@"<> " + Strings.Executing);
|
||||
Console.WriteLine($@"<> {Strings.Executing}");
|
||||
|
||||
ulong steamOwnerID = ASF.GlobalConfig?.SteamOwnerID ?? GlobalConfig.DefaultSteamOwnerID;
|
||||
|
||||
@@ -365,7 +365,7 @@ namespace ArchiSteamFarm.NLog {
|
||||
continue;
|
||||
}
|
||||
|
||||
Console.WriteLine(@"<< " + response);
|
||||
Console.WriteLine($@"<< {response}");
|
||||
} finally {
|
||||
OnUserInputEnd();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user