Class GLogFormatter

Direct Known Subclasses:
GColorLogFormatter, GStandardLogFormatter

public abstract class GLogFormatter extends SimpleFormatter
Base log formatter class.

Uses a compact time format and shows thread name. Made to log one-liners (except for exceptions).

  • Constructor Details

    • GLogFormatter

      protected GLogFormatter()
      Creates a base log formatter.
  • Method Details

    • format

      public String format(LogRecord record)
      Overrides:
      format in class SimpleFormatter
    • applyDateTime

      protected abstract void applyDateTime(StringBuilder sb, String value)
      Applies the datetime value to the log being built by the given StringBuilder.
      Parameters:
      sb - Log message builder.
      value - Value to apply.
    • applyLevel

      protected abstract void applyLevel(StringBuilder sb, String value)
      Applies the level value to the log being built by the given StringBuilder.
      Parameters:
      sb - Log message builder.
      value - Value to apply.
    • applyThreadName

      protected abstract void applyThreadName(StringBuilder sb, String value)
      Applies the threadName value to the log being built by the given StringBuilder.
      Parameters:
      sb - Log message builder.
      value - Value to apply.
    • applyClassName

      protected abstract void applyClassName(StringBuilder sb, String value)
      Applies the className value to the log being built by the given StringBuilder.
      Parameters:
      sb - Log message builder.
      value - Value to apply.
    • applyMessage

      protected abstract void applyMessage(StringBuilder sb, String value)
      Applies the message value to the log being built by the given StringBuilder.
      Parameters:
      sb - Log message builder.
      value - Value to apply.
    • applyThrowableMessage

      protected abstract void applyThrowableMessage(StringBuilder sb, String value)
      Applies the throwableMessage value to the log being built by the given StringBuilder.
      Parameters:
      sb - Log message builder.
      value - Value to apply.
    • applyThrowableTraceLine

      protected abstract void applyThrowableTraceLine(StringBuilder sb, String value)
      Applies the throwableTraceLine value to the log being built by the given StringBuilder.
      Parameters:
      sb - Log message builder.
      value - Value to apply.