Skip to content

Commit 6d20eec

Browse files
author
mwatson
committed
Performance tweak for Prefix
1 parent d328525 commit 6d20eec

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

Src/StackifyLib.log4net.v1_2_10/StackifyAppender.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ protected override void Append(LoggingEvent loggingEvent)
107107
//make sure the buffer isn't overflowing
108108
//if it is skip since we can't do anything with the message
109109

110-
if (_logClient.CanQueue() || Logger.SasquatchEnabled())
110+
if (Logger.PrefixEnabled() || _logClient.CanQueue())
111111
{
112112
var logMsg = Translate(loggingEvent);
113113
if (logMsg != null)

Src/StackifyLib.log4net/StackifyAppender.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ protected override void Append(LoggingEvent loggingEvent)
102102
//make sure the buffer isn't overflowing
103103
//if it is skip since we can't do anything with the message
104104

105-
if (_logClient.CanQueue() || Logger.SasquatchEnabled())
105+
if (Logger.PrefixEnabled() || _logClient.CanQueue())
106106
{
107107
var logMsg = Translate(loggingEvent);
108108
if (logMsg != null)

Src/StackifyLib.nLog/StackifyTarget.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ protected override void Write(LogEventInfo logEvent)
8181
{
8282
//make sure the buffer isn't overflowing
8383
//if it is skip since we can't do anything with the message
84-
if (_logClient.CanQueue() || Logger.SasquatchEnabled())
84+
if (Logger.PrefixEnabled() || _logClient.CanQueue())
8585
{
8686
var logMsg = Translate(logEvent);
8787
if (logMsg != null)

Src/StackifyLib/Logger.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public static void QueueLogObject(StackifyLib.Models.LogMsg msg)
172172
{
173173
try
174174
{
175-
if (_LogClient.CanQueue() || SasquatchEnabled())
175+
if (PrefixEnabled() || _LogClient.CanQueue())
176176
{
177177

178178
if (msg.Ex != null)
@@ -301,12 +301,12 @@ public static List<TraceFrame> GetCurrentStackTrace(string declaringClassName, i
301301
return frames;
302302
}
303303

304-
private static bool? _SasquatchEnabled = null;
304+
private static bool? _PrefixEnabled = null;
305305

306-
public static bool SasquatchEnabled()
306+
public static bool PrefixEnabled()
307307
{
308-
if (_SasquatchEnabled != null)
309-
return _SasquatchEnabled.Value;
308+
if (_PrefixEnabled != null)
309+
return _PrefixEnabled.Value;
310310

311311
var variable = Environment.GetEnvironmentVariable("StackSquatchUpdated");
312312

@@ -320,26 +320,26 @@ public static bool SasquatchEnabled()
320320
{
321321
if (updated > DateTime.UtcNow.AddHours(-1))
322322
{
323-
StackifyLib.Utils.StackifyAPILogger.Log("Sasquatch enabled", true);
324-
_SasquatchEnabled = true;
323+
StackifyLib.Utils.StackifyAPILogger.Log("Prefix enabled", true);
324+
_PrefixEnabled = true;
325325
}
326326
else
327327
{
328-
_SasquatchEnabled = false;
328+
_PrefixEnabled = false;
329329
}
330330
}
331331
else
332332
{
333-
_SasquatchEnabled = false;
333+
_PrefixEnabled = false;
334334
}
335335

336336
}
337337
else
338338
{
339-
_SasquatchEnabled = false;
339+
_PrefixEnabled = false;
340340
}
341341

342-
return _SasquatchEnabled.Value;
342+
return _PrefixEnabled.Value;
343343
}
344344
}
345345
}

0 commit comments

Comments
 (0)