Class Log

java.lang.Object
com.petarmc.lib.log.Log

public class Log extends Object
Utility class for obtaining logger instances. Supports injecting a custom PLogger implementation or creating default PLog instances.
  • Field Details

    • injected

      private static PLogger injected
  • Constructor Details

    • Log

      public Log()
  • Method Details

    • inject

      public static void inject(PLogger logger)
      Injects a custom logger to be returned by all get(Class, String) calls.
      Parameters:
      logger - the logger to inject
    • get

      public static PLogger get(Class<?> clazz, String prefix)
      Returns a logger instance for the specified class with a prefix.
      Parameters:
      clazz - the class for which the logger is requested
      prefix - the prefix to apply to this logger's messages
      Returns:
      a logger instance
    • get

      public static PLogger get(String name, String prefix)
      Returns a logger instance with the specified name and prefix.
      Parameters:
      name - the name of the logger
      prefix - the prefix to apply to this logger's messages
      Returns:
      a logger instance