Class Explainer

  • All Implemented Interfaces:

    
    public final class 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