Package org.eclipse.sisu.inject
Class Logs
java.lang.Object
org.eclipse.sisu.inject.Logs
Utility methods for dealing with container logging and recovery.
Set -Dsisu.debug to send detailed tracing to the console.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final classLogs.Sinks messages to the system console.(package private) static final classLogs.Sinks messages to the JDK.private static interfaceSomething that accepts formatted messages.(package private) static final classLogs.Sinks messages via SLF4J. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcatchThrowable(Throwable problem) Helper method for catchingThrowables; severe errors such asThreadDeathare always re-thrown.private static StringReplaces the first available formatting anchor with the given object.static StringidentityToString(Object object) Returns an identity string for the given object.static voidthrowUnchecked(Throwable problem) Helper method for throwingThrowables; checked exceptions are wrapped asProvisionExceptions.static StringtoString(com.google.inject.Injector injector) Returns a string representation of the givenInjector.static StringtoString(com.google.inject.Module module) Returns a string representation of the givenModule.static voidLogs a trace message; uses "{}" format anchors.static voidLogs a warning message; uses "{}" format anchors.
-
Field Details
-
NEW_LINE
-
SISU
- See Also:
-
SINK
-
TRACE_ENABLED
public static final boolean TRACE_ENABLED
-
-
Constructor Details
-
Logs
private Logs()
-
-
Method Details
-
trace
Logs a trace message; uses "{}" format anchors. PassThrowables in last parameter for special handling.- Parameters:
format- The trace message formatarg1- First object to formatarg2- Second object to format
-
warn
Logs a warning message; uses "{}" format anchors. PassThrowables in last parameter for special handling.- Parameters:
format- The warning message formatarg1- First object to formatarg2- Second object to format
-
catchThrowable
Helper method for catchingThrowables; severe errors such asThreadDeathare always re-thrown.- Parameters:
problem- The problem
-
throwUnchecked
Helper method for throwingThrowables; checked exceptions are wrapped asProvisionExceptions.- Parameters:
problem- The problem
-
identityToString
Returns an identity string for the given object.- Parameters:
object- The object- Returns:
- Identity string of the object.
- See Also:
-
toString
Returns a string representation of the givenModule.- Parameters:
module- The module- Returns:
- String representation of the module.
-
toString
Returns a string representation of the givenInjector.- Parameters:
injector- The injector- Returns:
- String representation of the injector.
-
format
Replaces the first available formatting anchor with the given object.- Parameters:
format- The format stringarg- The object to format
-