Package net.ssehub.easy.basics.logger
Class LogFormatter
- java.lang.Object
-
- java.util.logging.Formatter
-
- net.ssehub.easy.basics.logger.LogFormatter
-
public final class LogFormatter extends java.util.logging.FormatterThis Formatter is used by the EASyLogger to format the logging output.- Author:
- Sass
-
-
Field Summary
Fields Modifier and Type Field Description private static java.text.SimpleDateFormatDATE_FORMATprivate static java.lang.StringLINE_SEPARATOR
-
Constructor Summary
Constructors Constructor Description LogFormatter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidappendEclipseDebugLink(java.util.logging.LogRecord record, java.lang.StringBuilder sb)Appends a clickable link for the Eclipse IDE, which points to the file and line number where the Message was created.java.lang.Stringformat(java.util.logging.LogRecord record)private java.lang.StackTraceElementgetCallerStackFrame(java.lang.String callerName)Gets the CallerStackFrame for the Class throwing the exception.
-
-
-
Method Detail
-
format
public java.lang.String format(java.util.logging.LogRecord record)
- Specified by:
formatin classjava.util.logging.Formatter
-
appendEclipseDebugLink
private void appendEclipseDebugLink(java.util.logging.LogRecord record, java.lang.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 java.lang.StackTraceElement getCallerStackFrame(java.lang.String callerName)
Gets the CallerStackFrame for the Class throwing the exception.- Parameters:
callerName- Name of the class- Returns:
- StackTraceElement of callerName
-
-