Class ColumnedFormatter
java.lang.Object
dev.alphagame.trailblazer.formatters.AbstractFormatter
dev.alphagame.trailblazer.formatters.ColumnedFormatter
-
Field Summary
Fields inherited from class dev.alphagame.trailblazer.formatters.AbstractFormatter
dateFormat, format, outputStream
-
Constructor Summary
ConstructorsConstructorDescriptionColumnedFormatter
(PrintStream outputStream) ColumnedFormatter
(String columnSeparator, int columnWidth) ColumnedFormatter
(String columnSeparator, int columnWidth, PrintStream outputStream) -
Method Summary
Modifier and TypeMethodDescriptionvoid
formatLogMessage
(String level, String loggerName, String message) Formats a log message with the given level, logger name, and message into a columned format.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.Gets the column separator.int
Gets the column width.void
setColumnSeparator
(String separator) Sets the column separator.void
setColumnWidth
(int width) Sets the column width.Methods inherited from class dev.alphagame.trailblazer.formatters.AbstractFormatter
formatLogMessage, formatLogMessage, getOutputStream, setOutputStream
-
Constructor Details
-
ColumnedFormatter
public ColumnedFormatter() -
ColumnedFormatter
-
ColumnedFormatter
-
ColumnedFormatter
-
-
Method Details
-
formatLogMessage
Formats a log message with the given level, logger name, message, and arguments into a columned format.- Specified by:
formatLogMessage
in classAbstractFormatter
- Parameters:
level
- The log level.loggerName
- The name of the logger.message
- The log message.args
- The arguments to format the message with.
-
formatLogMessage
Formats a log message with the given level, logger name, and message into a columned format.- Specified by:
formatLogMessage
in classAbstractFormatter
- Parameters:
level
- The log level.loggerName
- The name of the logger.message
- The log message.
-
setColumnSeparator
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
Gets the column separator.- Returns:
- The column separator.
-
getColumnWidth
public int getColumnWidth()Gets the column width.- Returns:
- The column width.
-