InternalPathfinderLogger
This is an internal utility class for Pathfinder's logging system. It provides static methods for setting the logging output, retrieving it, and logging messages with optional filtering capabilities.
Fields
output
A Consumer<String> that represents the destination for log messages. If null, no messages will be logged. This is a static field, meaning it's shared across all instances and can be set globally.
shouldFilter
A boolean flag indicating whether log messages should be filtered based on defined LogFilter rules. Defaults to true.
filters
A Map where keys are String patterns and values are LogFilter enums, defining how messages should be filtered.
Methods
setOutput(Consumer<String> output)
Sets the Consumer<String> that will receive log messages. This allows for redirecting log output to various destinations (e.g., console, file, UI).
getOutput()
Returns the currently configured Consumer<String> for log output.
log(String message)
Logs a given message. Before logging, it checks if an output consumer is set and, if shouldFilter is true, applies any defined filters to the message. If the message passes all filters, it is then sent to the output consumer.