Add ProjectZomboidBurdJournalsLog (BurdJournals.txt)
Per-line warnings emitted by the BurdJournals mod, format '[time] [BurdJournals] LEVEL: message.'. Parser captures time, the [BurdJournals] tag as the entry prefix, and the LEVEL token. Detectors: filename match plus content signature on the literal '[BurdJournals]' tag bracket.
This commit is contained in:
44
src/Log/ProjectZomboid/ProjectZomboidBurdJournalsLog.php
Normal file
44
src/Log/ProjectZomboid/ProjectZomboidBurdJournalsLog.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace IndifferentKetchup\Codex\Log\ProjectZomboid;
|
||||
|
||||
use IndifferentKetchup\Codex\Analyser\AnalyserInterface;
|
||||
use IndifferentKetchup\Codex\Analyser\PatternAnalyser;
|
||||
use IndifferentKetchup\Codex\Detective\FilenameDetector;
|
||||
use IndifferentKetchup\Codex\Detective\WeightedSinglePatternDetector;
|
||||
use IndifferentKetchup\Codex\Parser\ParserInterface;
|
||||
use IndifferentKetchup\Codex\Parser\PatternParser;
|
||||
use IndifferentKetchup\Codex\Pattern\ProjectZomboid\BurdJournalsPattern;
|
||||
|
||||
class ProjectZomboidBurdJournalsLog extends ProjectZomboidEventLog
|
||||
{
|
||||
public static function getDefaultParser(): ParserInterface
|
||||
{
|
||||
return static::makePatternParser(
|
||||
BurdJournalsPattern::LINE,
|
||||
[PatternParser::TIME, PatternParser::PREFIX, PatternParser::LEVEL]
|
||||
);
|
||||
}
|
||||
|
||||
public static function getDefaultAnalyser(): AnalyserInterface
|
||||
{
|
||||
return new PatternAnalyser();
|
||||
}
|
||||
|
||||
public static function getDetectors(): array
|
||||
{
|
||||
return [
|
||||
(new FilenameDetector())
|
||||
->setPattern('/_BurdJournals\.txt$/')
|
||||
->setWeight(0.95),
|
||||
(new WeightedSinglePatternDetector())
|
||||
->setPattern('/\[BurdJournals\]/')
|
||||
->setWeight(0.95),
|
||||
];
|
||||
}
|
||||
|
||||
public function getTitle(): string
|
||||
{
|
||||
return "Project Zomboid BurdJournals Mod Log";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user