Unify Content's EntitySystem logging (#26216)
Use Log with generated sawmill name rather than explicitly named one for all non rule-based Content EntitySystems.
This commit is contained in:
@@ -13,7 +13,6 @@ public abstract class SharedDeviceLinkSystem : EntitySystem
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
|
||||
private ISawmill _sawmill = default!;
|
||||
|
||||
public const string InvokedPort = "link_port";
|
||||
|
||||
@@ -25,7 +24,6 @@ public abstract class SharedDeviceLinkSystem : EntitySystem
|
||||
SubscribeLocalEvent<DeviceLinkSinkComponent, ComponentStartup>(OnSinkStartup);
|
||||
SubscribeLocalEvent<DeviceLinkSourceComponent, ComponentRemove>(OnSourceRemoved);
|
||||
SubscribeLocalEvent<DeviceLinkSinkComponent, ComponentRemove>(OnSinkRemoved);
|
||||
_sawmill = Logger.GetSawmill("devicelink");
|
||||
}
|
||||
|
||||
#region Link Validation
|
||||
@@ -386,12 +384,12 @@ public abstract class SharedDeviceLinkSystem : EntitySystem
|
||||
|
||||
if (sourceComponent == null)
|
||||
{
|
||||
_sawmill.Error($"Attempted to remove link between {ToPrettyString(sourceUid)} and {ToPrettyString(sinkUid)}, but the source component was missing.");
|
||||
Log.Error($"Attempted to remove link between {ToPrettyString(sourceUid)} and {ToPrettyString(sinkUid)}, but the source component was missing.");
|
||||
sinkComponent!.LinkedSources.Remove(sourceUid);
|
||||
}
|
||||
else
|
||||
{
|
||||
_sawmill.Error($"Attempted to remove link between {ToPrettyString(sourceUid)} and {ToPrettyString(sinkUid)}, but the sink component was missing.");
|
||||
Log.Error($"Attempted to remove link between {ToPrettyString(sourceUid)} and {ToPrettyString(sinkUid)}, but the sink component was missing.");
|
||||
sourceComponent.LinkedPorts.Remove(sourceUid);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user