fix: Fixes structured logging (#1043)

- [X] Fixes various bugs in logging.
This commit is contained in:
Kamron Batman 2022-06-05 01:00:22 -07:00 committed by GitHub
parent 78bb4f4bb2
commit 6e69d25e33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 96 additions and 102 deletions

View file

@ -41,8 +41,9 @@ namespace Server
var amountToRefill = Math.Min(_maxPoolCapacity, amountToGrow);
var maximumHit = amountToGrow > amountToRefill ? " Maximum pool size has been reached." : "";
var warningMessage = $"Timer pool depleted by {{Amount}}. Refilling with {{AmountRefill}}.{maximumHit}";
logger.Warning($"Timer pool depleted by {_timerPoolDepletionAmount}. Refilling with {amountToRefill}.{maximumHit}");
logger.Warning(warningMessage, _timerPoolDepletionAmount, amountToRefill);
RefillPoolAsync(amountToRefill);
_timerPoolDepletionAmount = 0;
}
@ -62,7 +63,7 @@ namespace Server
_poolHead = head;
_poolCount += amount;
#if DEBUG_TIMERS
logger.Information($"Returning to pool. ({_poolCount} / {_poolCapacity})");
logger.Information("Returning to pool. ({Count} / {Capacity})", _poolCount, _poolCapacity);
#endif
}
@ -84,7 +85,7 @@ namespace Server
internal static void RefillPool(int amount, out DelayCallTimer head, out DelayCallTimer tail)
{
#if DEBUG_TIMERS
logger.Information($"Filling pool with {amount} timers.");
logger.Information("Filling pool with {Amount} timers.", amount);
#endif
head = null;