Einstein-Engines icon indicating copy to clipboard operation
Einstein-Engines copied to clipboard

Mirror: Obsolete `Logger` cleanup for `EntitySystem`s part 2

Open SimpleStation14 opened this issue 10 months ago • 2 comments

Mirror of PR #26159: Obsolete Logger cleanup for EntitySystems part 2 from space-wizards space-wizards/space-station-14

7d275a4b5e4188db424cc417c609dced3f9aca89

PR opened by LordCarve at 2024-03-15 20:15:41 UTC


PR changed 14 files with 36 additions and 25 deletions.

The PR had the following labels:

  • Status: Needs Review

Original Body

About the PR

Part 2 of 2, continuation of #25941 Gets rid of the remaining obsolete Logger method calls from all EntitySystems and uses the expected Log to get at the proper sawmill.

In particular:

  1. Make the ExamineSystemShared's InRangeUnObstructed non-static (so finally able to use instance-based Log rather than Logger) and inject dependency to all systems that were using it as static.
  2. Adjust 4 more EntitySystems to use Log rather than Logger that were missed in the previous PR.

Tested that the game runs and the affected systems direct logs to the correct sawmill.

Why / Balance

Using Logger directly for logging is marked obsolete. Brings some order to logs (i.e. all EntitySystem logs start with a preceding system.).

Technical details

I'm pretty sure ExamineSystemShared's InRangeUnObstructed not being static is the intended way since it being static dodges the IoC entirely. It even has dirty hacks such as getting the occluder system inside to make it happen. I didn't fix any of that as it's beyond the scope of this PR, but it's another thing that needs improving.

These are the changes to the log sawmills: ExamineSystemShared.cs: BEFORE: root -> NEW: system.examine AtmosphereSystem.Monstermos.cs: BEFORE: root -> NEW: system.atmosphere TypingIndicatorSystem.cs: BEFORE: root -> NEW: system.typing_indicator PiratesRuleSystem.cs BEFORE: pirates -> NEW: system.pirates_rule TabletopSystem.Session.cs BEFORE: root -> NEW: system.tabletop

Media

  • [X] I have added screenshots/videos to this PR showcasing its changes ingame, or this PR does not require an ingame showcase

Breaking changes

Some logs now fall under a different sawmill (more precise). Any software that analyzes logs and makes assumptions on which sawmill do these logs fall to will need to be adjusted.

SimpleStation14 avatar Apr 22 '24 09:04 SimpleStation14