fix: Makes logging more consistent (#1246)

This commit is contained in:
Kamron Batman 2022-11-13 00:36:23 -08:00 • committed by GitHub
parent 8e0d01d4be
commit d8cfb6b935
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 90 additions and 69 deletions

View file

@ -75,7 +75,7 @@ public partial class Timer
t.Start();
#if DEBUG_TIMERS
DelayCallTimer._stackTraces[t.GetHashCode()] = $"{callback.Method.Name}\n{new StackTrace()}";
DelayCallTimer._stackTraces[t.GetHashCode()] = $"{callback.Method.Name}{Environment.NewLine}{new StackTrace()}";
#endif
}
@ -102,7 +102,7 @@ public partial class Timer
t.Start();
#if DEBUG_TIMERS
DelayCallTimer._stackTraces[t.GetHashCode()] = $"{callback.Method.Name}\n{new StackTrace()}";
DelayCallTimer._stackTraces[t.GetHashCode()] = $"{callback.Method.Name}{Environment.NewLine}{new StackTrace()}";
#endif
token = new TimerExecutionToken(t);
}
@ -184,7 +184,7 @@ public partial class Timer
}
#if DEBUG_TIMERS
logger.Warning("Timer pool depleted and timer was allocated.\n{StackTrace}", new StackTrace());
logger.Warning($"Timer pool depleted and timer was allocated.{Environment.NewLine}{{StackTrace}}", new StackTrace());
#endif
return new DelayCallTimer(delay, interval, count, callback);
}
@ -198,7 +198,7 @@ public partial class Timer
{
if (!_allowFinalization)
{
logger.Warning("Pooled timer was not returned to the pool.\n{StackTrace}", _stackTraces[GetHashCode()]);
logger.Warning($"Pooled timer was not returned to the pool.{Environment.NewLine}{{StackTrace}}", _stackTraces[GetHashCode()]);
}
}
#endif