Class ColumnedFormatter

java.lang.Object
dev.alphagame.trailblazer.formatters.AbstractFormatter
dev.alphagame.trailblazer.formatters.ColumnedFormatter

public class ColumnedFormatter extends AbstractFormatter
  • Constructor Details

    • ColumnedFormatter

      public ColumnedFormatter()
    • ColumnedFormatter

      public ColumnedFormatter(PrintStream outputStream)
    • ColumnedFormatter

      public ColumnedFormatter(String columnSeparator, int columnWidth)
    • ColumnedFormatter

      public ColumnedFormatter(String columnSeparator, int columnWidth, PrintStream outputStream)
  • Method Details

    • formatLogMessage

      public void formatLogMessage(String level, String loggerName, String message, Object... args)
      Formats a log message with the given level, logger name, message, and arguments into a columned format.
      Specified by:
      formatLogMessage in class AbstractFormatter
      Parameters:
      level - The log level.
      loggerName - The name of the logger.
      message - The log message.
      args - The arguments to format the message with.
    • formatLogMessage

      public void formatLogMessage(String level, String loggerName, String message)
      Formats a log message with the given level, logger name, and message into a columned format.
      Specified by:
      formatLogMessage in class AbstractFormatter
      Parameters:
      level - The log level.
      loggerName - The name of the logger.
      message - The log message.
    • setColumnSeparator

      public void setColumnSeparator(String separator)
      Sets the column separator.
      Parameters:
      separator - The separator to use between columns.
    • setColumnWidth

      public void setColumnWidth(int width)
      Sets the column width.
      Parameters:
      width - The width of each column.
    • getColumnSeparator

      public String getColumnSeparator()
      Gets the column separator.
      Returns:
      The column separator.
    • getColumnWidth

      public int getColumnWidth()
      Gets the column width.
      Returns:
      The column width.