Fixed logging issues

This commit is contained in:
Chomp
2025-01-19 19:45:24 +00:00
parent 35518f0eef
commit fee4a32e1c
10 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -107,7 +107,7 @@ public class GameController(
// Flag as migrated
fullProfile.SptData.Migrations["310x"] = _timeUtil.GetTimeStamp();
_logger.Success($"Migration of 3.10.x profile: ${fullProfile.ProfileInfo?.Username} completed successfully");
_logger.Success($"Migration of 3.10.x profile: {fullProfile.ProfileInfo?.Username} completed successfully");
}
fullProfile.CharacterData!.PmcData!.WishList ??= new DictionaryOrList<string, int>(new Dictionary<string, int>(), []);
@@ -49,7 +49,7 @@ public class InsuranceController(
// Ensure hash has item in it
if (!inventoryItemsHash.ContainsKey(itemId))
{
_logger.Debug("Item with id: ${ itemId} missing from player inventory, skipping");
_logger.Debug($"Item with id: {itemId} missing from player inventory, skipping");
continue;
}
@@ -226,7 +226,7 @@ public class ProfileController(
var profileToView = _profileHelper.GetFullProfileByAccountId(request.AccountId);
if (profileToView?.CharacterData?.PmcData is null || profileToView.CharacterData.ScavData is null)
{
_logger.Warning($"Unable to get profile: ${request.AccountId} to show, falling back to own profile");
_logger.Warning($"Unable to get profile: {request.AccountId} to show, falling back to own profile");
profileToView = _profileHelper.GetFullProfile(sessionId);
}
@@ -249,7 +249,7 @@ public class RepeatableQuestController(
if (questStatusInProfile.Status == QuestStatusEnum.AvailableForFinish)
{
questsToKeep.Add(activeQuest);
_logger.Debug($"Keeping repeatable quest: ${activeQuest.Id} in activeQuests since it is available to hand in");
_logger.Debug($"Keeping repeatable quest: {activeQuest.Id} in activeQuests since it is available to hand in");
continue;
}
+3 -3
View File
@@ -317,7 +317,7 @@ public class BotGenerator(
var result = experiences[botDifficulty.ToLower()];
if (result is null)
{
_logger.Debug("Unable to find experience for kill value for: ${ role} ${ botDifficulty}, falling back to `normal`");
_logger.Debug($"Unable to find experience for kill value for: { role} { botDifficulty}, falling back to `normal`");
return _randomUtil.GetDouble(experiences["normal"].Min.Value, experiences["normal"].Max.Value);
}
@@ -473,8 +473,8 @@ public class BotGenerator(
/// <param name="output">Generated bot array, ready to send to client</param>
public void LogPmcGeneratedCount(List<BotBase> output)
{
var pmcCount = output.Aggregate(0, (acc, cur) => { return cur.Info.Side == "Bear" || cur.Info.Side == "Usec" ? acc + 1 : acc; });
_logger.Debug($"Generated {output.Count} total bots. Replaced ${pmcCount} with PMCs");
var pmcCount = output.Aggregate(0, (acc, cur) => { return cur.Info.Side is "Bear" or "Usec" ? acc + 1 : acc; });
_logger.Debug($"Generated {output.Count} total bots. Replaced {pmcCount} with PMCs");
}
/// <summary>
+1 -1
View File
@@ -387,7 +387,7 @@ public class InventoryHelper(
}
_logger.Debug(
"${ moveRequest.Action} item: ${ moveRequest.item} from slotid: ${ matchingInventoryItem.slotId} to container: ${ moveRequest.to.container}"
$"{ moveRequest.Action} item: ${ moveRequest.Item} from slotid: { matchingInventoryItem.SlotId} to container: { moveRequest.To.Container}"
);
// Don't move shells from camora to cartridges (happens when loading shells into mts-255 revolver shotgun)
+1 -1
View File
@@ -58,7 +58,7 @@ namespace Core.Routers
continue;
}
_logger.Debug("event: ${ body.Action}");
_logger.Debug($"event: { body.Action}");
await eventRouter.HandleItemEvent(body.Action, pmcData, body, sessionID, output);
if (output.Warnings.Count > 0) {
break;
+1 -1
View File
@@ -86,7 +86,7 @@ public class BotNameService(
{
// 5 attempts to generate a name, pool probably isn't big enough
var genericName = $"{botGenerationDetails.Side} {_randomUtil.GetInt(100000, 999999)}";
_logger.Debug($"Failed to find unique name for: {botRole} ${botGenerationDetails.Side} after 5 attempts, using: ${genericName}");
_logger.Debug($"Failed to find unique name for: {botRole} {botGenerationDetails.Side} after 5 attempts, using: {genericName}");
return genericName;
}
@@ -1,4 +1,4 @@
using SptCommon.Annotations;
using SptCommon.Annotations;
using Core.Helpers;
using Core.Models.Eft.Common.Tables;
using Core.Models.Enums;
@@ -166,7 +166,7 @@ public class BotWeaponModLimitService(
// Has mod limit for bot type been reached
if (currentCount.Count >= maxLimit)
{
// this.logger.debug(`[${botRole}] scope limit reached! tried to add ${modTpl} but scope count is ${currentCount.count}`);
// this.logger.debug($"[{botRole}] scope limit reached! tried to add {modTpl} but scope count is {currentCount.count}`);
return true;
}
@@ -16,7 +16,7 @@ public class MatchBotDetailsCacheService(
{
if (botToCache.Info.Nickname is null)
{
_logger.Warning($"Unable to cache: {botToCache.Info.Settings.Role} bot with id: ${botToCache.Id} as it lacks a nickname");
_logger.Warning($"Unable to cache: {botToCache.Info.Settings.Role} bot with id: {botToCache.Id} as it lacks a nickname");
return;
}