Skip to content

Commit aa7e58e

Browse files
author
mwatson
committed
Fix bug with errors not logging properly with the built in logger
1 parent 7e71630 commit aa7e58e

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

Src/StackifyLib/Logger.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,21 +193,28 @@ public static void QueueLogObject(StackifyLib.Models.LogMsg msg)
193193
msg.Msg = msg.Ex.ToString();
194194
}
195195

196-
if (!StackifyError.IgnoreError(msg.Ex) && _LogClient.ErrorShouldBeSent(msg.Ex))
196+
197+
bool ignore = StackifyError.IgnoreError(msg.Ex);
198+
bool shouldSend = _LogClient.ErrorShouldBeSent(msg.Ex);
199+
200+
201+
if (!ignore)
197202
{
198203
if (!string.IsNullOrEmpty(origMsg))
199204
{
200205
msg.Ex.SetAdditionalMessage(origMsg);
201206
}
202207

203-
//remove because of so many errors
204-
msg.Ex = null;
208+
if (!shouldSend)
209+
{
210+
msg.Ex = null;
211+
msg.Msg += " #errorgoverned";
212+
}
205213
}
206214
else
207215
{
208-
msg.Msg += " #errorgoverned";
216+
msg.Ex = null;
209217
}
210-
211218
}
212219

213220
_LogClient.QueueMessage(msg);

0 commit comments

Comments
 (0)