Interface ActionLogFormatter

All Known Implementing Classes:
NormalFormatter, QuietFormatter, VerboseFormatter

public interface ActionLogFormatter
Interface for formatting ActionResult data into log messages. Each implementation handles a specific verbosity level (QUIET, NORMAL, VERBOSE).

Formatters are responsible for:

  • Determining if an action should be logged at their verbosity level
  • Extracting relevant data from ActionResult
  • Formatting the data into appropriate string representation
  • Handling edge cases (missing data, null values, etc.)

Design principles:

  • Formatters are stateless - can be safely used by multiple threads
  • Formatters only read data - never modify ActionResult
  • Each formatter is responsible for one verbosity level only
  • Null return values indicate the action should not be logged
  • Method Details

    • format

      String format(ActionResult actionResult)
      Format an ActionResult into a log message string.
      Parameters:
      actionResult - the result of an action execution
      Returns:
      formatted log message, or null if this action should not be logged
    • shouldLog

      boolean shouldLog(ActionResult actionResult)
      Determine if an action should be logged at this verbosity level.
      Parameters:
      actionResult - the result to check
      Returns:
      true if this action should produce log output
    • getVerbosityLevel

      Get the verbosity level this formatter handles.
      Returns:
      the verbosity level