org.eclipse.net4j.util.om.trace

## Class PrintTraceHandler

- java.lang.Object
- - org.eclipse.net4j.util.om.trace.PrintTraceHandler

- All Implemented Interfaces:
    OMTraceHandler

      public class PrintTraceHandler
      extends java.lang.Object
      implements OMTraceHandler

  A `trace handler` that appends `trace events` to a `print stream`.
  Author:
    Eike Stepper

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static PrintTraceHandler` | `CONSOLE`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `PrintTraceHandler()`
    `` | `PrintTraceHandler(java.io.PrintStream stream)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.String` | `format(boolean shortContext, OMTraceHandlerEvent event)`
    `static java.lang.String` | `format(java.lang.String pattern, OMTraceHandlerEvent event)` Pattern arguments:
    `java.lang.String` | `getPattern()`
    `java.io.PrintStream` | `getStream()`
    `boolean` | `isShortContext()`
    `void` | `setPattern(java.lang.String pattern)` Pattern arguments:
    `void` | `setShortContext(boolean shortContext)`
    `void` | `traced(OMTraceHandlerEvent event)`

    - ### Methods inherited from class java.lang.Object

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

- - ### Field Detail

    - #### CONSOLE

          public static final PrintTraceHandler CONSOLE

  - ### Constructor Detail

    - #### PrintTraceHandler

          public PrintTraceHandler(java.io.PrintStream stream)

    - #### PrintTraceHandler

          protected PrintTraceHandler()

  - ### Method Detail

    - #### getStream

          public java.io.PrintStream getStream()

      Since:
        3.2

    - #### getPattern

          public java.lang.String getPattern()

    - #### setPattern

          public void setPattern(java.lang.String pattern)

      Pattern arguments:

      - {0} → String tracerName
      - {1} → String tracerShort
      - {2} → String contextName
      - {3} → String contextShort
      - {4} → long timeStamp
      - {5} → String message
      - {6} → String threadName
      - {7} → long threadID
      - {8} → int threadPriority
      - {9} → Thread.State threadState

    - #### isShortContext

          public boolean isShortContext()

    - #### setShortContext

          public void setShortContext(boolean shortContext)

    - #### traced

          public void traced(OMTraceHandlerEvent event)

      Specified by:
        `traced` in interface `OMTraceHandler`

    - #### format

          public static java.lang.String format(boolean shortContext,
                                                OMTraceHandlerEvent event)

    - #### format

          public static java.lang.String format(java.lang.String pattern,
                                                OMTraceHandlerEvent event)

      Pattern arguments:

      - {0} → String tracerName
      - {1} → String tracerShort
      - {2} → String contextName
      - {3} → String contextShort
      - {4} → long timeStamp
      - {5} → String message
      - {6} → String threadName
      - {7} → long threadID
      - {8} → int threadPriority
      - {9} → Thread.State threadState

Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html