wrap

public final Runnable wrap(Runnable r)

Wraps a runnable so it will execute within a new context based on the state of the builder. Note that each time this runnable is executed, a new context will be installed extending from the currently installed context at the time of execution.

Throws

InvalidLoggingScopeStateException

if the context created during this method cannot be closed correctly (e.g. if a nested context has also been opened, but not closed).


public final Callable<R> wrap<R>(Callable<R> c)

Wraps a callable so it will execute within a new context based on the state of the builder. Note that each time this runnable is executed, a new context will be installed extending from the currently installed context at the time of execution.

Throws

InvalidLoggingScopeStateException

if the context created during this method cannot be closed correctly (e.g. if a nested context has also been opened, but not closed).