fix: Fixes structured logging (#1043)
- [X] Fixes various bugs in logging.
This commit is contained in:
parent
78bb4f4bb2
commit
6e69d25e33
31 changed files with 96 additions and 102 deletions
|
|
@ -284,11 +284,11 @@ namespace Server
|
|||
|
||||
watch.Stop();
|
||||
|
||||
logger.Information(string.Format("World loaded ({1} items, {2} mobiles) ({0:F2} seconds)",
|
||||
logger.Information("World loaded ({ItemCount} items, {MobileCount} mobiles) ({Duration:F2} seconds)",
|
||||
watch.Elapsed.TotalSeconds,
|
||||
Items.Count,
|
||||
Mobiles.Count
|
||||
));
|
||||
);
|
||||
|
||||
WorldState = WorldState.Running;
|
||||
}
|
||||
|
|
@ -304,7 +304,7 @@ namespace Server
|
|||
{
|
||||
if (_pendingAdd.ContainsKey(entity.Serial))
|
||||
{
|
||||
logger.Warning("Entity {0} was both pending both deletion and addition after save", entity);
|
||||
logger.Warning("Entity {Entity} was both pending both deletion and addition after save", entity);
|
||||
}
|
||||
|
||||
RemoveEntity(entity);
|
||||
|
|
@ -402,7 +402,7 @@ namespace Server
|
|||
|
||||
watch.Stop();
|
||||
|
||||
logger.Information("Writing world save snapshot done ({0:F2} seconds)", watch.Elapsed.TotalSeconds);
|
||||
logger.Information("Writing world save snapshot done ({Duration:F2} seconds)", watch.Elapsed.TotalSeconds);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -505,7 +505,7 @@ namespace Server
|
|||
if (exception == null)
|
||||
{
|
||||
var duration = watch.Elapsed.TotalSeconds;
|
||||
logger.Information("World save completed ({0:F2} seconds)", duration);
|
||||
logger.Information("World save completed ({Duration:F2} seconds)", duration);
|
||||
|
||||
// Only broadcast if it took at least 150ms
|
||||
if (duration >= 0.15)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue