Class AgentFormatter
java.lang.Object
java.util.logging.Formatter
madkit.logging.AgentFormatter
- Direct Known Subclasses:
AgentFileFormatter
This class extends the Formatter class to provide a custom log formatter for agents. It
formats log records based on their level and includes a header with the logger name.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.util.logging.Formatter
formatMessage, getHead, getTail
-
Constructor Details
-
AgentFormatter
public AgentFormatter()
-
-
Method Details
-
format
Formats the given log record. If the log level is AgentLogger.TALK, only the message is returned. Otherwise, a formatted string with the log level and message is returned. -
getHeader
Returns a StringBuilder containing the logger name as the header for the log record.- Parameters:
record
- the log record for which the header is to be returned- Returns:
- a StringBuilder containing the logger name
-