Interface LogTheme
public interface LogTheme
Interface for themed log message formatting.
Log themes add fun prefixes and transformations to log messages, improving developer experience during debugging.
Usage
LogTheme theme = LogThemes.STAR_WARS;
String message = theme.format(LogEvent.ACTION_START, "Executing search");
// "[JEDI] Executing search"
Custom Theme
LogTheme custom = new LogTheme() {
public String name() { return "custom"; }
public String format(LogEvent event, String message) {
return "[MY-PREFIX] " + message;
}
};
- Author:
- TnsAI Team
- See Also:
-
Method Details
-
name
String name()Theme name for configuration.- Returns:
- theme identifier (e.g., "starwars", "lotr")
-
format
Formats a log message with theme styling.- Parameters:
event- the type of log eventmessage- the original message- Returns:
- themed message
-
startupMessage
Optional: Returns a fun startup message.- Returns:
- startup banner or null
-
shutdownMessage
Optional: Returns a shutdown message.- Returns:
- shutdown message or null
-