Package ch.k43.util

Klasse KLogYAMLFormatter

java.lang.Object
java.util.logging.Formatter
ch.k43.util.KLogYAMLFormatter

public class KLogYAMLFormatter extends Formatter
Format logging output as YAML formatted string with UUID, time stamp, logging level, code location and the logging information. The KLog.debug(), KLog.info() and KLog.error() adds the code location, delimited by KLog.DELIMITER which is then formatted here.
 Example:
 KLog.info("Program start");
 
 Output:
 ---
 KLog:
 - UUID: "ce95a558-ed95-4288-b759-0d2ba69dbd5e"
   Logtime: "2024-09-14T10:12:42.428"
   Level: "Debug"
   Location: "main[1]:ch.k43.util.KLog:open:458"
   Text: "===== Application started 2024-09-14T10:12:42.375 ====="
 - UUID: "fec270e6-7bfb-40ad-8460-5295ff617626"
   Logtime: "2024-09-14T10:12:42.429"
   Level: "Debug"
   Location: "main[1]:ch.k43.util.KLog:open:459"
   Text: "Java Utility Package (Freeware) ch.k43.util Version 2024.09.12"
 ...
 
  • Konstruktordetails

    • KLogYAMLFormatter

      public KLogYAMLFormatter()
      Class constructor.
  • Methodendetails

    • format

      public String format(LogRecord argRecord)
      Format the log message
      Angegeben von:
      format in Klasse Formatter
    • getHead

      public String getHead(Handler argHandler)
      Set header.
      Setzt außer Kraft:
      getHead in Klasse Formatter
    • getTail

      public String getTail(Handler argHandler)
      Set YAML footer. Note: Due to a bug in the JVM, the getTail() is not called by the ConsoleHandler.
      Setzt außer Kraft:
      getTail in Klasse Formatter
    • toString

      public String toString()
      String representation of object.
      Setzt außer Kraft:
      toString in Klasse Object
      Seit:
      2024.08.23