Make all current admin logs use ToPrettyString
This commit is contained in:
@@ -187,7 +187,7 @@ namespace Content.Shared.Chemistry.Reaction
|
||||
{
|
||||
var entity = args.SolutionEntity;
|
||||
_logSystem.Add(LogType.ReagentEffect, effect.LogImpact,
|
||||
$"Reaction effect {effect.GetType().Name} of reaction ${reaction.ID:reaction} applied on entity {entity} at {EntityManager.GetComponent<TransformComponent>(entity).Coordinates}");
|
||||
$"Reaction effect {effect.GetType().Name} of reaction ${reaction.ID:reaction} applied on entity {ToPrettyString(entity)} at {Transform(entity).Coordinates}");
|
||||
}
|
||||
|
||||
effect.Effect(args);
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace Content.Shared.Chemistry
|
||||
{
|
||||
var entity = args.SolutionEntity;
|
||||
_logSystem.Add(LogType.ReagentEffect, effect.LogImpact,
|
||||
$"Reactive effect {effect.GetType().Name} of reagent {reagent.ID:reagent} with method {method} applied on entity {entity} at {EntityManager.GetComponent<TransformComponent>(entity).Coordinates}");
|
||||
$"Reactive effect {effect.GetType().Name} of reagent {reagent.ID:reagent} with method {method} applied on entity {ToPrettyString(entity)} at {Transform(entity).Coordinates}");
|
||||
}
|
||||
|
||||
effect.Effect(args);
|
||||
@@ -94,7 +94,7 @@ namespace Content.Shared.Chemistry
|
||||
{
|
||||
var entity = args.SolutionEntity;
|
||||
_logSystem.Add(LogType.ReagentEffect, effect.LogImpact,
|
||||
$"Reactive effect {effect.GetType().Name} of {entity} using reagent {reagent.ID} with method {method} at {EntityManager.GetComponent<TransformComponent>(entity).Coordinates}");
|
||||
$"Reactive effect {effect.GetType().Name} of {ToPrettyString(entity)} using reagent {reagent.ID} with method {method} at {Transform(entity).Coordinates}");
|
||||
}
|
||||
|
||||
effect.Effect(args);
|
||||
|
||||
@@ -123,7 +123,7 @@ namespace Content.Shared.Chemistry.Reagent
|
||||
{
|
||||
var entity = args.SolutionEntity;
|
||||
EntitySystem.Get<SharedAdminLogSystem>().Add(LogType.ReagentEffect, plantMetabolizable.LogImpact,
|
||||
$"Plant metabolism effect {plantMetabolizable.GetType().Name:effect} of reagent {ID} applied on entity {entity} at {IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).Coordinates}");
|
||||
$"Plant metabolism effect {plantMetabolizable.GetType().Name:effect} of reagent {ID} applied on entity {entMan.ToPrettyString(entity)} at {entMan.GetComponent<TransformComponent>(entity).Coordinates}");
|
||||
plantMetabolizable.Effect(args);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -673,7 +673,7 @@ namespace Content.Shared.Hands.Components
|
||||
|
||||
HandlePickupAnimation(entity);
|
||||
PutEntityIntoHand(hand, entity);
|
||||
EntitySystem.Get<SharedAdminLogSystem>().Add(LogType.Pickup, LogImpact.Low, $"{Owner} picked up {entity}");
|
||||
EntitySystem.Get<SharedAdminLogSystem>().Add(LogType.Pickup, LogImpact.Low, $"{_entMan.ToPrettyString(Owner)} picked up {_entMan.ToPrettyString(entity)}");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -468,7 +468,7 @@ namespace Content.Shared.Interaction
|
||||
RaiseLocalEvent(used, activateMsg);
|
||||
if (activateMsg.Handled)
|
||||
{
|
||||
_adminLogSystem.Add(LogType.InteractActivate, LogImpact.Low, $"{user} activated {used}");
|
||||
_adminLogSystem.Add(LogType.InteractActivate, LogImpact.Low, $"{ToPrettyString(user)} activated {ToPrettyString(used)}");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -477,7 +477,7 @@ namespace Content.Shared.Interaction
|
||||
|
||||
var activateEventArgs = new ActivateEventArgs(user, used);
|
||||
activateComp.Activate(activateEventArgs);
|
||||
_adminLogSystem.Add(LogType.InteractActivate, LogImpact.Low, $"{user} activated {used}"); // No way to check success.
|
||||
_adminLogSystem.Add(LogType.InteractActivate, LogImpact.Low, $"{ToPrettyString(user)} activated {ToPrettyString(used)}"); // No way to check success.
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -556,7 +556,7 @@ namespace Content.Shared.Interaction
|
||||
RaiseLocalEvent(thrown, throwMsg);
|
||||
if (throwMsg.Handled)
|
||||
{
|
||||
_adminLogSystem.Add(LogType.Throw, LogImpact.Low,$"{user} threw {thrown}");
|
||||
_adminLogSystem.Add(LogType.Throw, LogImpact.Low,$"{ToPrettyString(user)} threw {ToPrettyString(thrown)}");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -568,7 +568,7 @@ namespace Content.Shared.Interaction
|
||||
{
|
||||
comp.Thrown(args);
|
||||
}
|
||||
_adminLogSystem.Add(LogType.Throw, LogImpact.Low,$"{user} threw {thrown}");
|
||||
_adminLogSystem.Add(LogType.Throw, LogImpact.Low,$"{ToPrettyString(user)} threw {ToPrettyString(thrown)}");
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -677,7 +677,7 @@ namespace Content.Shared.Interaction
|
||||
RaiseLocalEvent(item, dropMsg);
|
||||
if (dropMsg.Handled)
|
||||
{
|
||||
_adminLogSystem.Add(LogType.Drop, LogImpact.Low, $"{user} dropped {item}");
|
||||
_adminLogSystem.Add(LogType.Drop, LogImpact.Low, $"{ToPrettyString(user)} dropped {ToPrettyString(item)}");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -690,7 +690,7 @@ namespace Content.Shared.Interaction
|
||||
{
|
||||
comp.Dropped(new DroppedEventArgs(user));
|
||||
}
|
||||
_adminLogSystem.Add(LogType.Drop, LogImpact.Low, $"{user} dropped {item}");
|
||||
_adminLogSystem.Add(LogType.Drop, LogImpact.Low, $"{ToPrettyString(user)} dropped {ToPrettyString(item)}");
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace Content.Shared.Slippery
|
||||
PlaySound(component);
|
||||
}
|
||||
|
||||
_adminLog.Add(LogType.Slip, LogImpact.Low, $"{otherBody.Owner} slipped on collision with {component.Owner}");
|
||||
_adminLog.Add(LogType.Slip, LogImpact.Low, $"{ToPrettyString(otherBody.Owner)} slipped on collision with {ToPrettyString(component.Owner)}");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace Content.Shared.Throwing
|
||||
|
||||
// Assume it's uninteresting if it has no thrower. For now anyway.
|
||||
if (thrownItem.Thrower is not null)
|
||||
_adminLogSystem.Add(LogType.Landed, LogImpact.Low, $"{landing} thrown by {thrownItem.Thrower:thrower} landed.");
|
||||
_adminLogSystem.Add(LogType.Landed, LogImpact.Low, $"{ToPrettyString(landing)} thrown by {ToPrettyString(thrownItem.Thrower.Value):thrower} landed.");
|
||||
|
||||
var landMsg = new LandEvent {User = thrownItem.Thrower};
|
||||
RaiseLocalEvent(landing, landMsg, false);
|
||||
@@ -141,7 +141,7 @@ namespace Content.Shared.Throwing
|
||||
{
|
||||
if (user is not null)
|
||||
_adminLogSystem.Add(LogType.ThrowHit, LogImpact.Low,
|
||||
$"{thrown.Owner:thrown} thrown by {user:thrower} hit {target.Owner:target}.");
|
||||
$"{ToPrettyString(thrown.Owner):thrown} thrown by {ToPrettyString(user.Value):thrower} hit {ToPrettyString(target.Owner):target}.");
|
||||
// TODO: Just pass in the bodies directly
|
||||
RaiseLocalEvent(target.Owner, new ThrowHitByEvent(user, thrown.Owner, target.Owner));
|
||||
RaiseLocalEvent(thrown.Owner, new ThrowDoHitEvent(user, thrown.Owner, target.Owner));
|
||||
|
||||
@@ -139,10 +139,10 @@ namespace Content.Shared.Verbs
|
||||
// then log with entity information
|
||||
if (used != null)
|
||||
_logSystem.Add(LogType.Verb, verb.Impact,
|
||||
$"{user} {logText} {target} while holding {used}");
|
||||
$"{ToPrettyString(user)} {logText} {ToPrettyString(target)} while holding {ToPrettyString(used.Value)}");
|
||||
else
|
||||
_logSystem.Add(LogType.Verb, verb.Impact,
|
||||
$"{user} {logText} {target}");
|
||||
$"{ToPrettyString(user)} {logText} {ToPrettyString(target)}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user