From 67e8ddef30512264381cb391b2f8ac273fdd127e Mon Sep 17 00:00:00 2001 From: Chomp Date: Mon, 3 Feb 2025 11:29:01 +0000 Subject: [PATCH] Logging improvements --- Libraries/Core/Controllers/RepeatableQuestController.cs | 2 +- Libraries/Core/Helpers/BotGeneratorHelper.cs | 6 +++--- Libraries/Core/Servers/ConfigServer.cs | 6 +++--- Libraries/Core/Services/RagfairPriceService.cs | 6 +++--- Libraries/Core/Utils/Watermark.cs | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Libraries/Core/Controllers/RepeatableQuestController.cs b/Libraries/Core/Controllers/RepeatableQuestController.cs index 7caa5175..dcf7d56e 100644 --- a/Libraries/Core/Controllers/RepeatableQuestController.cs +++ b/Libraries/Core/Controllers/RepeatableQuestController.cs @@ -105,7 +105,7 @@ public class RepeatableQuestController( { // Unable to find quest being replaced var message = - $"Unable to generate repeatable quest of type: {repeatableTypeLower} to replace trader: ${replacedQuestTraderId} quest: {changeRequest.QuestId}"; + $"Unable to generate repeatable quest of type: {repeatableTypeLower} to replace trader: {replacedQuestTraderId} quest: {changeRequest.QuestId}"; _logger.Error(message); return _httpResponseUtil.AppendErrorToOutput(output, message); diff --git a/Libraries/Core/Helpers/BotGeneratorHelper.cs b/Libraries/Core/Helpers/BotGeneratorHelper.cs index 424c195c..ed6724fe 100644 --- a/Libraries/Core/Helpers/BotGeneratorHelper.cs +++ b/Libraries/Core/Helpers/BotGeneratorHelper.cs @@ -348,7 +348,7 @@ public class BotGeneratorHelper( ); if (blockingItem is not null) { - // this.logger.warning(`1 incompatibility found between - ${itemToEquip[1]._name} and ${blockingItem._name} - ${equipmentSlot}`); + // this.logger.warning(`1 incompatibility found between - {itemToEquip[1]._name} and {blockingItem._name} - {equipmentSlot}`); return new() { @@ -361,7 +361,7 @@ public class BotGeneratorHelper( blockingItem = templateItems.FirstOrDefault(x => x?.Properties?.ConflictingItems?.Contains(tplToCheck) ?? false); if (blockingItem is not null) { - // this.logger.warning(`2 incompatibility found between - ${itemToEquip[1]._name} and ${blockingItem._props.Name} - ${equipmentSlot}`); + // this.logger.warning(`2 incompatibility found between - {itemToEquip[1]._name} and {blockingItem._props.Name} - {equipmentSlot}`); return new ChooseRandomCompatibleModResult { Incompatible = true, @@ -439,7 +439,7 @@ public class BotGeneratorHelper( var blockingInventoryItem = itemsEquipped.FirstOrDefault((x) => itemToEquip.Properties.ConflictingItems?.Contains(x.Template) ?? false); if (blockingInventoryItem is not null) { - // this.logger.warning(`3 incompatibility found between - ${itemToEquip[1]._name} and ${blockingInventoryItem._tpl} - ${equipmentSlot}`) + // this.logger.warning(`3 incompatibility found between - {itemToEquip[1]._name} and {blockingInventoryItem._tpl} - {equipmentSlot}`) return new ChooseRandomCompatibleModResult { Incompatible = true, diff --git a/Libraries/Core/Servers/ConfigServer.cs b/Libraries/Core/Servers/ConfigServer.cs index 234a03b8..813bd221 100644 --- a/Libraries/Core/Servers/ConfigServer.cs +++ b/Libraries/Core/Servers/ConfigServer.cs @@ -1,4 +1,4 @@ -using SptCommon.Annotations; +using SptCommon.Annotations; using Core.Models.Enums; using Core.Models.Spt.Config; using Core.Models.Utils; @@ -78,10 +78,10 @@ public class ConfigServer } /** TODO: deal with this: - this.logger.info(`Commit hash: ${ + this.logger.info(`Commit hash: { globalThis.G_COMMIT || "DEBUG" }`); - this.logger.info(`Build date: ${ + this.logger.info(`Build date: { globalThis.G_BUILDTIME || "DEBUG" }`); **/ diff --git a/Libraries/Core/Services/RagfairPriceService.cs b/Libraries/Core/Services/RagfairPriceService.cs index 74f63235..25e439a1 100644 --- a/Libraries/Core/Services/RagfairPriceService.cs +++ b/Libraries/Core/Services/RagfairPriceService.cs @@ -381,7 +381,7 @@ public class RagfairPriceService( ) { // var itemDetails = this.itemHelper.getItem(itemTpl); - // this.logger.debug(`item below handbook price ${itemDetails[1]._name} handbook: ${itemHandbookPrice} flea: ${itemPrice} ${priceDifferencePercent}%`); + // this.logger.debug(`item below handbook price {itemDetails[1]._name} handbook: {itemHandbookPrice} flea: ${itemPrice} {priceDifferencePercent}%`); return Math.Round(itemHandbookPrice.Value * offerAdjustmentSettings.HandbookPriceMultiplier); } @@ -486,8 +486,8 @@ public class RagfairPriceService( { _logger.Debug( nonDefaultPresets.Count == 1 - ? $"Item Id: ${weapon.Template} has no default encyclopedia entry but only one preset: ({nonDefaultPresets[0].Name}), choosing preset: ({nonDefaultPresets[0].Name})" - : $"Item Id: ${weapon.Template} has no default encyclopedia entry, choosing first preset(${nonDefaultPresets[0].Name}) of ${nonDefaultPresets.Count}" + ? $"Item Id: {weapon.Template} has no default encyclopedia entry but only one preset: ({nonDefaultPresets[0].Name}), choosing preset: ({nonDefaultPresets[0].Name})" + : $"Item Id: {weapon.Template} has no default encyclopedia entry, choosing first preset({nonDefaultPresets[0].Name}) of {nonDefaultPresets.Count}" ); } diff --git a/Libraries/Core/Utils/Watermark.cs b/Libraries/Core/Utils/Watermark.cs index d584f7bf..30c1f1d4 100644 --- a/Libraries/Core/Utils/Watermark.cs +++ b/Libraries/Core/Utils/Watermark.cs @@ -128,7 +128,7 @@ public class Watermark { var sptVersion = /*ProgramStatics.SPT_VERSION ||*/ sptConfig.SptVersion; var versionTag = /*ProgramStatics.DEBUG ? */ $"{sptVersion} - BLEEDINGEDGE { /*ProgramStatics.COMMIT?.slice(0, 6) ?? */""}"; - //: `${sptVersion} - ${ProgramStatics.COMMIT?.slice(0, 6) ?? ""}`; + //: `{sptVersion} - {ProgramStatics.COMMIT?.slice(0, 6) ?? ""}`; return $"{sptConfig.ProjectName} {versionTag}"; }