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
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
Verbosity levels supported by the logging system. -
Method Summary
Modifier and TypeMethodDescriptionformat
(ActionResult actionResult) Format an ActionResult into a log message string.Get the verbosity level this formatter handles.boolean
shouldLog
(ActionResult actionResult) Determine if an action should be logged at this verbosity level.
-
Method Details
-
format
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
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
ActionLogFormatter.VerbosityLevel getVerbosityLevel()Get the verbosity level this formatter handles.- Returns:
- the verbosity level
-