Package lib.util

Class Logging

java.lang.Object
lib.util.Logging

public final class Logging extends Object
  • Method Details

    • cooldown

      public static boolean cooldown(String key, double delaySeconds)
      Returns:
      True if at least delaySeconds seconds have passed since this function was last called with the same key.
    • log

      public static void log(String key)
      Log a string with a cooldown to not flood the RioLog™.
      Parameters:
      key - String to log; also used to determine the time since the last message with the same key was sent
    • logWithDelay

      public static void logWithDelay(String key, double delaySeconds)
      Log a string with a cooldown to not flood the RioLog™.
      Parameters:
      key - String to log; also used to determine the time since the last message with the same key was sent
      delaySeconds - Minimum cooldown between logs
    • log

      public static <T> T log(String key, T value, Object... others)
      Log values with a cooldown to not flood the RioLog™. Formatted as 'key: value' or 'key: val1, val2, ...'
      Parameters:
      key - Key that is used to determine the time since the last message with the same key was sent
      value - Value to log
      others - Additional values to log
      Returns:
      The first value (for chaining)
    • logWithDelay

      public static <T> T logWithDelay(String key, double delaySeconds, T value, Object... others)
      Log values with a cooldown to not flood the RioLog™. Formatted as 'key: value' or 'key: val1, val2, ...'
      Parameters:
      key - Key that is used to determine the time since the last message with the same key was sent
      delaySeconds - Minimum cooldown between logs
      value - Value to log
      others - Additional values to log
      Returns:
      The first value (for chaining)