Skip to content

Commit 6c4be93

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/master' into feature/excludes
2 parents fecbde6 + 689978d commit 6c4be93

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

Source/Extras/Extensions/ExceptionlessExtraConfigurationExtensions.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ public static void ReadFromConfigSection(this ExceptionlessConfiguration config)
9090
if (section == null)
9191
return;
9292

93-
config.Enabled = section.Enabled;
93+
if (!section.Enabled)
94+
config.Enabled = false;
9495

9596
if (IsValidApiKey(section.ApiKey))
9697
config.ApiKey = section.ApiKey;
@@ -171,8 +172,8 @@ public static void ReadFromAppSettings(this ExceptionlessConfiguration config) {
171172
config.ApiKey = apiKey;
172173

173174
bool enabled;
174-
if (Boolean.TryParse(ConfigurationManager.AppSettings["Exceptionless:Enabled"], out enabled))
175-
config.Enabled = enabled;
175+
if (Boolean.TryParse(ConfigurationManager.AppSettings["Exceptionless:Enabled"], out enabled) && !enabled)
176+
config.Enabled = false;
176177

177178
string serverUrl = ConfigurationManager.AppSettings["Exceptionless:ServerUrl"];
178179
if (!String.IsNullOrEmpty(serverUrl))
@@ -189,8 +190,8 @@ public static void ReadFromEnvironmentalVariables(this ExceptionlessConfiguratio
189190
config.ApiKey = apiKey;
190191

191192
bool enabled;
192-
if (Boolean.TryParse(GetEnvironmentalVariable("Exceptionless:Enabled"), out enabled))
193-
config.Enabled = enabled;
193+
if (Boolean.TryParse(GetEnvironmentalVariable("Exceptionless:Enabled"), out enabled) && !enabled)
194+
config.Enabled = false;
194195

195196
string serverUrl = GetEnvironmentalVariable("Exceptionless:ServerUrl");
196197
if (!String.IsNullOrEmpty(serverUrl))

Source/Shared/Extensions/ExceptionlessConfigurationExtensions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ public static void ReadFromAttributes(this ExceptionlessConfiguration config, IC
171171

172172
var attr = attributes[0] as ExceptionlessAttribute;
173173

174-
config.Enabled = attr.Enabled;
174+
if (!attr.Enabled)
175+
config.Enabled = false;
175176

176177
if (!String.IsNullOrEmpty(attr.ApiKey) && attr.ApiKey != "API_KEY_HERE")
177178
config.ApiKey = attr.ApiKey;

0 commit comments

Comments
 (0)