net.sf.farrago.util
Class NativeTrace
java.lang.Object
net.sf.farrago.util.NativeTrace
public class NativeTrace
- extends Object
NativeTrace provides integration between native code and Java logging
facilities.
- Version:
- $Id: //open/dev/farrago/src/net/sf/farrago/util/NativeTrace.java#16 $
- Author:
- John V. Sichi
Constructor Summary |
protected |
NativeTrace(String loggerPrefix)
Creates a new NativeTrace object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
instance
private static NativeTrace instance
TRACE_PERFCOUNTER_BEGIN_SNAPSHOT
private static final int TRACE_PERFCOUNTER_BEGIN_SNAPSHOT
- See Also:
- Constant Field Values
TRACE_PERFCOUNTER_END_SNAPSHOT
private static final int TRACE_PERFCOUNTER_END_SNAPSHOT
- See Also:
- Constant Field Values
TRACE_PERFCOUNTER_UPDATE
private static final int TRACE_PERFCOUNTER_UPDATE
- See Also:
- Constant Field Values
SEGMENT_LOGGER_PREFIX
private static final String SEGMENT_LOGGER_PREFIX
- See Also:
- Constant Field Values
XO_LOGGER_PREFIX
private static final String XO_LOGGER_PREFIX
- See Also:
- Constant Field Values
loggerPrefix
private String loggerPrefix
perfCounters
private Map<String,String> perfCounters
perfCountersNew
private Map<String,String> perfCountersNew
NativeTrace
protected NativeTrace(String loggerPrefix)
- Creates a new NativeTrace object. Do not construct NativeTrace objects
directly. This constructor is protected only for the use of subclasses.
- Parameters:
loggerPrefix
- prefix to use in constructing logger names
createInstance
public static void createInstance(String loggerPrefix)
instance
public static NativeTrace instance()
getLogger
private Logger getLogger(String loggerSuffix,
boolean stripLoggerIdentity)
getSourceTraceLevel
private int getSourceTraceLevel(String loggerSuffix)
- Called from native code to determine the trace level for a given
component.
- Parameters:
loggerSuffix
- suffix to use in constructing logger name
- Returns:
- trace level to use for named source (from Level enum)
trace
private void trace(String loggerSuffix,
int iLevel,
String message)
- Called from native code to emit a trace message.
- Parameters:
loggerSuffix
- suffix to use in constructing logger nameiLevel
- level (from Level enum) at which to tracemessage
- trace message text
handlePerfCounter
private void handlePerfCounter(int iLevel,
String loggerSuffix,
String message)
getPerfCounters
public Map<String,String> getPerfCounters()
- Returns:
- a consistent snapshot of all performance counters currently set