Explainer
A diagnostic recorder for a single search run.
An instance collects why a search reached its result: which recipes became candidates, which check rejected a recipe, and which predicate failed. Pass one to io.github.sakaki_aruka.customcrafter.search.Search.search (or its async / partial counterparts) and read the collected lines back with getLogs or getStringList.
Lines are recorded only when their level is not more verbose than verbosity: Loglevel.WARN alone keeps errors, Loglevel.INFO adds what happened, and Loglevel.DEBUG adds the concrete values behind each decision.
This class is safe to share across threads. io.github.sakaki_aruka.customcrafter.search.Search.asyncSearch evaluates candidate recipes in parallel and writes to one instance from every worker, so lines from different recipes interleave. Every line carries the recipe it belongs to, and the recorded order is a faithful trace of the actual execution order.
Since
5.3.0
Parameters
The most verbose level to keep. (default = Loglevel.INFO)
Label for this instance. Only used to tell instances apart. (default = a random UUID)
Constructors
Types
Properties
Functions
Returns every recorded line in the order it was written.
Returns recorded lines rendered as "[LEVEL] message", keeping only targetLevels.
Records a line when level is not more verbose than verbosity.