Class Logs

java.lang.Object
org.eclipse.sisu.inject.Logs

public final class Logs extends Object
Utility methods for dealing with container logging and recovery.

Set -Dsisu.debug to send detailed tracing to the console.

  • Field Details

    • NEW_LINE

      public static final String NEW_LINE
    • SISU

      private static final String SISU
      See Also:
    • SINK

      private static final Logs.Sink SINK
    • TRACE_ENABLED

      public static final boolean TRACE_ENABLED
  • Constructor Details

    • Logs

      private Logs()
  • Method Details

    • trace

      public static void trace(String format, Object arg1, Object arg2)
      Logs a trace message; uses "{}" format anchors. Pass Throwables in last parameter for special handling.
      Parameters:
      format - The trace message format
      arg1 - First object to format
      arg2 - Second object to format
    • warn

      public static void warn(String format, Object arg1, Object arg2)
      Logs a warning message; uses "{}" format anchors. Pass Throwables in last parameter for special handling.
      Parameters:
      format - The warning message format
      arg1 - First object to format
      arg2 - Second object to format
    • catchThrowable

      public static void catchThrowable(Throwable problem)
      Helper method for catching Throwables; severe errors such as ThreadDeath are always re-thrown.
      Parameters:
      problem - The problem
    • throwUnchecked

      public static void throwUnchecked(Throwable problem)
      Helper method for throwing Throwables; checked exceptions are wrapped as ProvisionExceptions.
      Parameters:
      problem - The problem
    • identityToString

      public static String identityToString(Object object)
      Returns an identity string for the given object.
      Parameters:
      object - The object
      Returns:
      Identity string of the object.
      See Also:
    • toString

      public static String toString(com.google.inject.Module module)
      Returns a string representation of the given Module.
      Parameters:
      module - The module
      Returns:
      String representation of the module.
    • toString

      public static String toString(com.google.inject.Injector injector)
      Returns a string representation of the given Injector.
      Parameters:
      injector - The injector
      Returns:
      String representation of the injector.
    • format

      private static String format(String format, Object arg)
      Replaces the first available formatting anchor with the given object.
      Parameters:
      format - The format string
      arg - The object to format