Class AbstractFormatter
java.lang.Object
dev.alphagame.trailblazer.formatters.AbstractFormatter
- Direct Known Subclasses:
ColumnedFormatter
,JSONFormatter
,SimpleFormatter
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
formatLogMessage
(String level, String message) Formats a log message with the given level and message (legacy method).void
formatLogMessage
(String level, String message, Object... args) Formats a log message with the given level, message, and arguments (legacy method).abstract void
formatLogMessage
(String level, String loggerName, String message) Formats a log message with the given level, logger name, and message.abstract void
formatLogMessage
(String level, String loggerName, String message, Object... args) Formats a log message with the given level, logger name, message, and arguments.Gets the current output stream.void
setOutputStream
(PrintStream outputStream) Sets the output stream for this formatter.
-
Field Details
-
format
-
dateFormat
-
outputStream
-
-
Constructor Details
-
AbstractFormatter
public AbstractFormatter() -
AbstractFormatter
-
-
Method Details
-
setOutputStream
Sets the output stream for this formatter.- Parameters:
outputStream
- The output stream to write to.
-
getOutputStream
Gets the current output stream.- Returns:
- The current output stream.
-
formatLogMessage
public abstract void formatLogMessage(String level, String loggerName, String message, Object... args) Formats a log message with the given level, logger name, message, and arguments.- 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.- Parameters:
level
- The log level.loggerName
- The name of the logger.message
- The log message.
-
formatLogMessage
Formats a log message with the given level, message, and arguments (legacy method).- Parameters:
level
- The log level.message
- The log message.args
- The arguments to format the message with.
-
formatLogMessage
Formats a log message with the given level and message (legacy method).- Parameters:
level
- The log level.message
- The log message.
-