java.lang.Object
org.cybergarage.util.Debug

public final class Debugextends Object
Debug utility class for the CyberLink framework.

This class provides debug logging functionality that integrates with the I2P logging system. It supports conditional debug output based on configuration settings.

All methods are static to provide convenient access throughout the framework. Debug output can be enabled/disabled at runtime.

  • Field Summary

    Modifier and Type
    Field
    Description
    private static Log
    Logger for this class.
    static boolean
    Flag indicating whether debug output is enabled.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Private constructor to prevent instantiation
  • Method Summary

    All Methods
    Modifier and Type
    Method
    Description
    static void
    Initializes debug system with I2P application context.
    static boolean
    Checks if debug output is enabled.
    static final void
    Logs a debug message.
    static final void
    Logs two debug messages.
    static final void
    off()
    Disables debug output.
    static final void
    on()
    Enables debug output.
    static final void
    Logs an exception as a warning.
    static final void
    Logs a warning message.
    static final void
    Logs a warning message with exception.

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • _log

      private static Log _log
      Logger for this class.
    • enabled

      public static boolean enabled
      Flag indicating whether debug output is enabled. When true, debug messages will be logged; when false, they are suppressed.
  • Constructor Details

    • Debug

      private Debug()
      Private constructor to prevent instantiation
  • Method Details

    • initialize

      public static void initialize(I2PAppContext ctx)
      Initializes debug system with I2P application context.
      Parameters:
      ctx - I2P application context for logging
    • on

      public static final void on()
      Enables debug output.
    • off

      public static final void off()
      Disables debug output.
    • isOn

      public static boolean isOn()
      Checks if debug output is enabled.
      Returns:
      true if debug is enabled, false otherwise
    • message

      public static final void message(String s)
      Logs a debug message.
      Parameters:
      s - message to log
    • message

      public static final void message(String m1, String m2)
      Logs two debug messages.
      Parameters:
      m1 - first message to log
      m2 - second message to log
    • warning

      public static final void warning(String s)
      Logs a warning message.
      Parameters:
      s - warning message to log
    • warning

      public static final void warning(String m, Exception e)
      Logs a warning message with exception.
      Parameters:
      m - warning message to log
      e - exception to log
    • warning

      public static final void warning(Exception e)
      Logs an exception as a warning.
      Parameters:
      e - exception to log