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:
@@ -28,14 +28,10 @@ namespace Content.Server.Forensics
|
||||
[Dependency] private readonly SharedAudioSystem _audioSystem = default!;
|
||||
[Dependency] private readonly MetaDataSystem _metaData = default!;
|
||||
|
||||
private ISawmill _sawmill = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
_sawmill = Logger.GetSawmill("forensics.scanner");
|
||||
|
||||
SubscribeLocalEvent<ForensicScannerComponent, AfterInteractEvent>(OnAfterInteract);
|
||||
SubscribeLocalEvent<ForensicScannerComponent, AfterInteractUsingEvent>(OnAfterInteractUsing);
|
||||
SubscribeLocalEvent<ForensicScannerComponent, BeforeActivatableUIOpenEvent>(OnBeforeActivatableUIOpen);
|
||||
@@ -57,7 +53,7 @@ namespace Content.Server.Forensics
|
||||
component.PrintReadyAt);
|
||||
|
||||
if (!_uiSystem.TrySetUiState(uid, ForensicScannerUiKey.Key, state))
|
||||
_sawmill.Warning($"{ToPrettyString(uid)} was unable to set UI state.");
|
||||
Log.Warning($"{ToPrettyString(uid)} was unable to set UI state.");
|
||||
}
|
||||
|
||||
private void OnDoAfter(EntityUid uid, ForensicScannerComponent component, DoAfterEvent args)
|
||||
@@ -180,7 +176,7 @@ namespace Content.Server.Forensics
|
||||
{
|
||||
if (!args.Session.AttachedEntity.HasValue)
|
||||
{
|
||||
_sawmill.Warning($"{ToPrettyString(uid)} got OnPrint without Session.AttachedEntity");
|
||||
Log.Warning($"{ToPrettyString(uid)} got OnPrint without Session.AttachedEntity");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -200,7 +196,7 @@ namespace Content.Server.Forensics
|
||||
|
||||
if (!HasComp<PaperComponent>(printed))
|
||||
{
|
||||
_sawmill.Error("Printed paper did not have PaperComponent.");
|
||||
Log.Error("Printed paper did not have PaperComponent.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user