Class ActionLoggingService

java.lang.Object
io.github.jspinak.brobot.logging.modular.ActionLoggingService

@Service public class ActionLoggingService extends Object
Centralized service for logging action executions using modular formatters.

This service acts as the single point of entry for action logging, routing ActionResult objects to the appropriate formatter based on configured verbosity level and outputting the formatted messages.

Design principles: - Single responsibility: Only handles logging coordination - Configurable: Verbosity level driven by configuration - Extensible: Easy to add new formatters or output destinations - Testable: Clear separation of concerns

  • Constructor Details

  • Method Details

    • logAction

      public void logAction(ActionResult actionResult)
      Log an action execution using the configured verbosity level.
      Parameters:
      actionResult - the result of action execution
    • logAction

      public void logAction(ActionResult actionResult, ActionLogFormatter.VerbosityLevel verbosityLevel)
      Log an action with explicit verbosity level override.
      Parameters:
      actionResult - the result of action execution
      verbosityLevel - the specific verbosity level to use
    • wouldLog

      public boolean wouldLog(ActionResult actionResult)
      Check if a specific action would be logged at current verbosity level.
      Parameters:
      actionResult - the action result to check
      Returns:
      true if this action would produce log output
    • getAvailableFormatters

      public Map<ActionLogFormatter.VerbosityLevel,ActionLogFormatter> getAvailableFormatters()
      Get available formatters for testing/debugging.
    • getCurrentVerbosityLevel

      public ActionLogFormatter.VerbosityLevel getCurrentVerbosityLevel()
      Get current verbosity level for external inspection.