Class PtfLogger

java.lang.Object
net.minheur.potoflux.logger.PtfLogger

public final class PtfLogger extends Object
Class used to log in potoflux.
  • Constructor Details

    • PtfLogger

      public PtfLogger()
  • Method Details

    • buildPrefix

      public static String buildPrefix(List<String> data)
      Method to get the prefix of the command.
      It contains the time, and all the components given in args. They are put in between []
      Parameters:
      data - the list of components to add to the prefix
      Returns:
      the built prefix
    • buildPrefix

      public static String buildPrefix(String... data)
      Builder retuning buildPrefix(List), but with the categories as a vararg.
      Parameters:
      data - vararg of the categories
      Returns:
      the built prefix
    • buildWithCategory

      public static String buildWithCategory(String category, String message, List<String> more)
      Builds the message with a main category
      Parameters:
      category - main category of the message
      message - content of the log
      more - adds more categories to the log
      Returns:
      the message
    • info

      public static void info(String message, String... extraCategories)
      Print an info log message, with a content and optional categories
      Parameters:
      message - content of the log
      extraCategories - optional categories of the log
    • info

      public static void info(String message, ILogCategory category, String... extraCategories)
      Print an info log message, with a content, a main log category (in the form of an ILogCategory) and optional categories
      Parameters:
      message - content of the log
      category - main category of the log, should be a ILogCategory
      extraCategories - optional categories of the log
    • warning

      public static void warning(String message, String... extraCategories)
      Print a warning log message, with a content and optional categories
      Parameters:
      message - content of the log
      extraCategories - optional categories of the log
    • warning

      public static void warning(String message, ILogCategory category, String... extraCategories)
      Print a warning log message, with a content, a main log category (in the form of an ILogCategory) and optional categories
      Parameters:
      message - content of the log
      category - main category of the log, should be a ILogCategory
      extraCategories - optional categories of the log
    • error

      public static void error(String message, String... extraCategories)
      Print an error log message, with a content and optional categories
      Parameters:
      message - content of the log
      extraCategories - optional categories of the log
    • error

      public static void error(String message, ILogCategory category, String... extraCategories)
      Print an error log message, with a content, a main log category (in the form of an ILogCategory) and optional categories
      Parameters:
      message - content of the log
      category - main category of the log, should be a ILogCategory
      extraCategories - optional categories of the log