From d863fae9e62a954916c834a5f3a3179b88a4f60a Mon Sep 17 00:00:00 2001 From: indifferentketchup Date: Thu, 30 Apr 2026 20:34:03 +0000 Subject: [PATCH] Add ProjectZomboidServerLog (DebugLog-server.txt) Concrete Log subclass for the engine debug log. Captures time, level, and subsystem prefix per entry; stack-trace continuation lines attach to the triggering ERROR entry via PatternParser's append-on-no-match behaviour. Detectors: filename match on DebugLog-server.txt plus two content signatures (the version=X.Y.Z+hash banner and the level/ subsystem/f/t/st header shape). Pattern constants live in src/Pattern/ProjectZomboid/DebugServerPattern.php with named groups ready for analyser use in phase B. Synthetic fixture under test/src/Games/ProjectZomboid/fixtures/ uses zeroed identifiers and placeholder paths. --- .../ProjectZomboidServerLog.php | 54 +++++++++++++++ src/Pattern/ProjectZomboid/.gitkeep | 0 .../ProjectZomboid/DebugServerPattern.php | 27 ++++++++ .../fixtures/debug-server-minimal.txt | 22 ++++++ .../Log/ProjectZomboidServerLogTest.php | 67 +++++++++++++++++++ 5 files changed, 170 insertions(+) create mode 100644 src/Log/ProjectZomboid/ProjectZomboidServerLog.php delete mode 100644 src/Pattern/ProjectZomboid/.gitkeep create mode 100644 src/Pattern/ProjectZomboid/DebugServerPattern.php create mode 100644 test/src/Games/ProjectZomboid/fixtures/debug-server-minimal.txt create mode 100644 test/tests/Games/ProjectZomboid/Log/ProjectZomboidServerLogTest.php diff --git a/src/Log/ProjectZomboid/ProjectZomboidServerLog.php b/src/Log/ProjectZomboid/ProjectZomboidServerLog.php new file mode 100644 index 0000000..617fd89 --- /dev/null +++ b/src/Log/ProjectZomboid/ProjectZomboidServerLog.php @@ -0,0 +1,54 @@ +setPattern('/DebugLog-server\.txt$/') + ->setWeight(0.95), + (new WeightedSinglePatternDetector()) + ->setPattern('/version=\d+\.\d+\.\d+ [a-f0-9]{40}/') + ->setWeight(0.95), + (new WeightedSinglePatternDetector()) + ->setPattern('/^\[\d{2}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}\] (?:LOG|WARN|ERROR):\s+\w+\s+f:\d+, t:\d+, st:[\d,]+>/m') + ->setWeight(0.80), + ]; + } + + public function getTitle(): string + { + return "Project Zomboid Debug Server Log"; + } +} diff --git a/src/Pattern/ProjectZomboid/.gitkeep b/src/Pattern/ProjectZomboid/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/Pattern/ProjectZomboid/DebugServerPattern.php b/src/Pattern/ProjectZomboid/DebugServerPattern.php new file mode 100644 index 0000000..c58c00f --- /dev/null +++ b/src/Pattern/ProjectZomboid/DebugServerPattern.php @@ -0,0 +1,27 @@ +\s+.*$/'; + + public const string VERSION = '/version=(?\S+) (?[a-f0-9]{40}) (?\d{4}-\d{2}-\d{2}) (?