Package org.eclipse.net4j.util.om.trace

# Klasse ContextTracer

java.lang.Object
org.eclipse.net4j.util.om.trace.ContextTracer

Bekannte direkte Unterklassen:
  `PerfTracer`

public class ContextTracer extends Object
Encapsulates a tracing `context` and delegates trace calls to a bundle `tracer`.

Autor:
  Eike Stepper
Siehe auch:
  - `PerfTracer`

## Konstruktorübersicht

Konstruktoren
Konstruktor
Beschreibung
`ContextTracer(OMTracer delegate, Class<?> context)`

## Methodenübersicht

Modifizierer und Typ
Methode
Beschreibung
`void`
`format(String pattern, Object... args)`
`void`
`format(String pattern, Throwable t, Object... args)`
`OMBundle`
`getBundle()`
`Class<?>`
`getContext()`
`OMTracer`
`getDelegate()`
`String`
`getFullName()`
`String`
`getName()`
`OMTracer`
`getParent()`
`boolean`
`ifEnabled(Consumer<ContextTracer> consumer)`
Provides zero-cost tracing in combination with the `assert` keyword.
`boolean`
`isEnabled()`
`void`
`setEnabled(boolean enabled)`
`String`
`toString()`
`void`
`trace(String msg)`
`void`
`trace(String msg, Throwable t)`
`void`
`trace(Throwable t)`

### Von Klasse geerbte Methoden java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Konstruktordetails

### ContextTracer

public ContextTracer(OMTracer delegate, Class<?> context)

## Methodendetails

### getContext

public Class<?> getContext()

Seit:
  3.2

### getBundle

public OMBundle getBundle()

### getFullName

public String getFullName()

### getName

public String getName()

### getDelegate

public OMTracer getDelegate()

### getParent

public OMTracer getParent()

### isEnabled

public boolean isEnabled()

### setEnabled

public void setEnabled(boolean enabled)

### ifEnabled

public boolean ifEnabled(Consumer<ContextTracer> consumer)
Provides zero-cost tracing in combination with the `assert` keyword.

Example:

``

       ContextTracer tracer = ...;

       assert tracer.ifEnabled(t -> t.format("User %0 logged on", user));

Gibt zurück:
  Always `true`
Seit:
  3.16

### format

public void format(String pattern, Object... args)

### format

public void format(String pattern, Throwable t, Object... args)

### trace

public void trace(String msg, Throwable t)

### trace

public void trace(String msg)

### trace

public void trace(Throwable t)

### toString

public String toString()

Setzt außer Kraft:
  `toString` in Klasse `Object`