Class Logger

java.lang.Object
com.j3d.engine.Logger

public class Logger extends Object
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 Details

  • Constructor Details

    • Logger

      public Logger()
      Constructs a Logger instance with the specified JTextArea.
  • Method Details

    • setLogArea

      public void setLogArea(JTextArea logArea)
    • getTimestamp

      private String getTimestamp()
      Gets the current timestamp in the format <HH:MM:SS>.
      Returns:
      The current timestamp as a string.
    • appendIfTest

      public String appendIfTest(String message)
    • println

      public void println(String message)
      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

      public void uiPrintLn(String message)
    • cmdPrintln

      public void cmdPrintln(String s)
    • stPrintln

      public void stPrintln(String s)
    • error

      public void error(String message)
      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

      public void error(J3DError err)
    • testPrintln

      public void testPrintln(String s)