Class LogFormatter

java.lang.Object
java.util.logging.Formatter
net.ssehub.easy.basics.logger.LogFormatter

public final class LogFormatter extends Formatter
This Formatter is used by the EASyLogger to format the logging output.
Author:
Sass
  • Field Details

    • LINE_SEPARATOR

      private static final String LINE_SEPARATOR
    • DATE_FORMAT

      private static final SimpleDateFormat DATE_FORMAT
  • Constructor Details

    • LogFormatter

      public LogFormatter()
  • Method Details

    • format

      public String format(LogRecord record)
      Specified by:
      format in class Formatter
    • appendEclipseDebugLink

      private void appendEclipseDebugLink(LogRecord record, StringBuilder sb)
      Appends a clickable link for the Eclipse IDE, which points to the file and line number where the Message was created. Note:
      • Only useful when Code was compiled with debug information
      • Only useful when EASy is executed inside Eclipse
      Parameters:
      record - the log record to be formatted.
      sb - the formatted log record (which is currently build.
    • getCallerStackFrame

      private StackTraceElement getCallerStackFrame(String callerName)
      Gets the CallerStackFrame for the Class throwing the exception.
      Parameters:
      callerName - Name of the class
      Returns:
      StackTraceElement of callerName