diff --git a/src/Octopus.OpenFeature.Provider.Tests/OctopusFeatureContextTests.cs b/src/Octopus.OpenFeature.Provider.Tests/OctopusFeatureContextTests.cs index c8f163d..5b18d40 100644 --- a/src/Octopus.OpenFeature.Provider.Tests/OctopusFeatureContextTests.cs +++ b/src/Octopus.OpenFeature.Provider.Tests/OctopusFeatureContextTests.cs @@ -425,29 +425,5 @@ public void GetNormalizedNumber_MatchesExpectedValue(string evaluationKey, strin { OctopusFeatureContext.GetNormalizedNumber(evaluationKey, targetingKey).Should().Be(expected); } - - [Fact] - public void WhenSameMissingSlug_IsEvaluatedRepeatedly_OnlyOneWarningIsLogged() - { - var featureToggles = new FeatureToggles([ - new FeatureToggleEvaluation("known-feature", true, "evaluation-key", [], 100) - ], []); - var fakeLogger = new FakeLogger(); - var context = new OctopusFeatureContext(featureToggles, new SingleLoggerFactory(fakeLogger)); - - for (var i = 0; i < 10; i++) - { - context.Evaluate("missing-slug", defaultValue: false, context: null); - } - - fakeLogger.Collector.GetSnapshot().Should().ContainSingle(r => r.Level == LogLevel.Warning); - } - - class SingleLoggerFactory(ILogger logger) : ILoggerFactory - { - public ILogger CreateLogger(string categoryName) => logger; - public void AddProvider(ILoggerProvider provider) { } - public void Dispose() { } - } } diff --git a/src/Octopus.OpenFeature.Provider/OctopusFeatureContext.cs b/src/Octopus.OpenFeature.Provider/OctopusFeatureContext.cs index 9639f94..fcf543f 100644 --- a/src/Octopus.OpenFeature.Provider/OctopusFeatureContext.cs +++ b/src/Octopus.OpenFeature.Provider/OctopusFeatureContext.cs @@ -11,8 +11,6 @@ namespace Octopus.OpenFeature.Provider; partial class OctopusFeatureContext(FeatureToggles toggles, ILoggerFactory loggerFactory) { public byte[] ContentHash => toggles.ContentHash; - readonly ILogger logger = loggerFactory.CreateLogger(); - readonly ConcurrentDictionary warnedSlugs = new(StringComparer.OrdinalIgnoreCase); public static OctopusFeatureContext Empty(ILoggerFactory loggerFactory) { @@ -30,13 +28,6 @@ public ResolutionDetails Evaluate(string slug, bool defaultValue, Evaluati if (feature == null) { - if (warnedSlugs.TryAdd(slug, 0)) - { - logger.LogWarning( - "The slug {Slug} did not match any of your Octopus Feature Toggles. Please double check your slug and try again.", - slug); - } - return new ResolutionDetails(slug, defaultValue, ErrorType.FlagNotFound, "The slug provided did not match any of your Octopus Feature Toggles. Please double check your slug and try again."); }