Package com.j3d.engine
Class Logger
java.lang.Object
com.j3d.engine.Logger
The Logger class provides a simple logging utility.
It supports logging messages to both the console and the
DebugPanel.logTextArea
This class includes methods for standard logging, error logging, and clearing the log area.- Author:
- Lehlogonolo Poole
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendIfTest(String message) voidclear()Clears the log area.voidcmdPrintln(String s) voidvoidLogs an error message.private StringGets the current timestamp in the format <HH:MM:SS>.voidLogs a standard message.voidsetLogArea(JTextArea logArea) voidvoidvoid
-
Field Details
-
PREFIX
- See Also:
-
ERROR_PREFIX
- See Also:
-
logArea
-
-
Constructor Details
-
Logger
public Logger()Constructs a Logger instance with the specified JTextArea.
-
-
Method Details
-
setLogArea
-
getTimestamp
Gets the current timestamp in the format <HH:MM:SS>.- Returns:
- The current timestamp as a string.
-
appendIfTest
-
println
Logs a standard message. The message is prefixed with[J3D]and printed to the console. If a JTextArea is provided, the message is also appended to it.- Parameters:
message- The message to log.
-
uiPrintLn
-
cmdPrintln
-
stPrintln
-
error
Logs an error message. The message is prefixed with[J3D-ERR]and printed to the error console. If a JTextArea is provided, the message is also appended to it.- Parameters:
message- The error message to log.
-
clear
public void clear()Clears the log area. If a `JTextArea` is provided, its content is cleared. -
error
-
testPrintln
-