Package org.eclipse.sisu.inject
Class Logs
- java.lang.Object
-
- org.eclipse.sisu.inject.Logs
-
public final class Logs extends java.lang.Object
Utility methods for dealing with container logging and recovery.Set -Dsisu.debug to send detailed tracing to the console.
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
DEBUG_ENABLED
static java.lang.String
NEW_LINE
static boolean
TRACE_ENABLED
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
catchThrowable(java.lang.Throwable problem)
Helper method for catchingThrowable
s; severe errors such asThreadDeath
are always re-thrown.static void
debug(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
Logs a debug message; uses "{}" format anchors.static java.lang.String
identityToString(java.lang.Object object)
Returns an identity string for the given object.static void
throwUnchecked(java.lang.Throwable problem)
Helper method for throwingThrowable
s; checked exceptions are wrapped asProvisionException
s.static java.lang.String
toString(com.google.inject.Injector injector)
Returns a string representation of the givenInjector
.static java.lang.String
toString(com.google.inject.Module module)
Returns a string representation of the givenModule
.static void
trace(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
Logs a trace message; uses "{}" format anchors.static void
warn(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
Logs a warning message; uses "{}" format anchors.
-
-
-
Method Detail
-
trace
public static void trace(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
Logs a trace message; uses "{}" format anchors. PassThrowable
s in last parameter for special handling.- Parameters:
format
- The trace message formatarg1
- First object to formatarg2
- Second object to format
-
debug
public static void debug(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
Logs a debug message; uses "{}" format anchors. PassThrowable
s in last parameter for special handling.- Parameters:
format
- The trace message formatarg1
- First object to formatarg2
- Second object to format
-
warn
public static void warn(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
Logs a warning message; uses "{}" format anchors. PassThrowable
s in last parameter for special handling.- Parameters:
format
- The warning message formatarg1
- First object to formatarg2
- Second object to format
-
catchThrowable
public static void catchThrowable(java.lang.Throwable problem)
Helper method for catchingThrowable
s; severe errors such asThreadDeath
are always re-thrown.- Parameters:
problem
- The problem
-
throwUnchecked
public static void throwUnchecked(java.lang.Throwable problem)
Helper method for throwingThrowable
s; checked exceptions are wrapped asProvisionException
s.- Parameters:
problem
- The problem
-
identityToString
public static java.lang.String identityToString(java.lang.Object object)
Returns an identity string for the given object.- Parameters:
object
- The object- Returns:
- Identity string of the object.
- See Also:
System.identityHashCode(Object)
-
toString
public static java.lang.String toString(com.google.inject.Module module)
Returns a string representation of the givenModule
.- Parameters:
module
- The module- Returns:
- String representation of the module.
-
toString
public static java.lang.String toString(com.google.inject.Injector injector)
Returns a string representation of the givenInjector
.- Parameters:
injector
- The injector- Returns:
- String representation of the injector.
-
-