|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.erights.e.develop.trace.Trace
Untamed: This might better be called TraceCache, but the name is retained for backward compatibility. The major purpose of this class is to hold a cache of a relevant trace priority threshold, so that a user of the trace code can quickly decide whether to call a trace method. Methods on this object communicate with the master TraceController, which does the real work of tracing.
Secondarily, this class holds some miscellaneous functions useful in tracing.
Field Summary | |
static String[] |
acceptorNames
|
static int |
ADD
|
static Trace |
captp
Enabled: |
static Trace |
causality
Enabled: |
static Trace |
comm
Enabled: comm systems |
static Trace |
console
Enabled: |
boolean |
debug
Enabled: Debug messages provide more detail for people who want to delve into what's going on, probably to figure out a bug. |
static int |
DEBUG
|
static String |
DEFAULT_NAME
|
static Trace |
dgc
Enabled: Distributed garbage collector. |
static Trace |
entropy
Enabled: |
boolean |
error
Enabled: Error messages report on some internal error. |
static int |
ERROR
The different trace thresholds. |
static Trace |
eruntime
Enabled: The E runtime |
boolean |
event
Enabled: Event messages describe the major actions the system takes in response to user actions. |
static int |
EVENT
|
static int |
FOR_SUBSYSTEM
|
static int |
FROM_DEFAULT
When referring to thresholds, are we talking about those from the default thresholds, or ones specific to a subsystem? XXX These could be interned strings, but interning didn't work right in 1.0.4. |
static int |
IRRELEVANT
|
static int |
LOG
This identifies the TraceMessageAcceptor used for the on-disk log. |
static String |
LOG_EXTENSION
|
static int |
MAX_THRESHOLD
|
(package private) TraceSubsystemMediator |
myMediator
This is the mediator that actually disposes of a message. |
private String |
mySubsystem
The subsystem is the group of classes this Trace object applies to. |
static int |
NUM_ACCEPTORS
The number of different types of TraceMessageAcceptors. |
static boolean |
ON
Enabled: Set this to false to compile out all tracing. |
static int |
OVERWRITE
|
static Trace |
pumpkin
Enabled: |
static String[] |
reasonNames
|
static long |
SMALLEST_LOG_SIZE_THRESHOLD
|
static int |
STARTING_LOG_BACKUP_ACTION
|
static File |
STARTING_LOG_DIR
|
static long |
STARTING_LOG_SIZE_THRESHOLD
|
static String |
STARTING_LOG_TAG
|
static int |
STARTING_LOG_THRESHOLD
|
static boolean |
STARTING_LOG_WRITE
|
static int |
STARTING_TRACE_BUFFER_SIZE
|
static int |
STARTING_TRACE_THRESHOLD
|
static Trace |
startup
Enabled: Classes involved in starting up the world. |
private static Object |
synchronizationObject
Synchronized static methods are prone to deadlocks in Sun's JVM. |
static Trace |
timers
Enabled: |
boolean |
timing
Enabled: Timing messages are for performance tuning. |
static int |
TIMING
As a late addition, there's a "timing" boolean that can be set orthogonally from the thresholds. |
static Trace |
trace
Enabled: |
static int |
TRACE
This identifies the TraceMessageAcceptor used for the in-core trace and its associated window. |
static Trace |
tunnel
Enabled: |
static String |
UNLIMITED_NAME
|
boolean |
usage
Enabled: Usage messages are used to answer the question "who did what up to the point the bug appeared?" ("Spock entered Azturf. |
static int |
USAGE
|
boolean |
verbose
Enabled: Verbose messages provide even more detail than debug. |
static int |
VERBOSE
|
static String |
version
|
boolean |
warning
Enabled: Warning messages are not as serious as errors, but they're signs of something odd. |
static int |
WARNING
|
static Trace |
wire
Enabled: |
boolean |
world
Enabled: World messages track the state of the world as a whole. |
static int |
WORLD
|
Constructor Summary | |
Trace(String subsystem)
Enabled: Initialize a Trace object for the given subsystem. |
Method Summary | |
void |
$(String message)
Enabled: |
static String |
arrayToString(Object[] a,
String name,
String pre,
String sep,
String post)
Enabled: Convert an array to a string. |
void |
debugm(String message)
Enabled: |
void |
debugm(String message,
Object o)
Enabled: |
void |
errorm(String message)
Enabled: |
void |
errorm(String message,
int bugNumber)
Enabled: |
void |
errorm(String message,
Object o)
Enabled: |
void |
errorm(String message,
Object o,
int bugNumber)
Enabled: |
void |
eventm(String message)
Enabled: |
void |
eventm(String message,
Object o)
Enabled: |
void |
fatalError(String message)
Enabled: Exit reporting a fatal error. |
void |
notifyFatal()
Enabled: Notify a user that a fatal error has happened. |
void |
notifyOptional()
Enabled: If the user wants to hear about nonfatal bugs, notify her. |
private void |
recordTraceMessageXyzzY(String message,
int level,
Object o,
boolean noNotify)
The peculiar name is because the code that finds the line number a trace call was made from searches for this method. |
void |
setTraceMode(String mode)
Enabled: It is no longer legal for anyone other than the TraceController to set the trace mode. |
void |
shred(Throwable ex,
String reason)
Enabled: To ensure that exceptional conditions are only being ignored for good reason, we adopt the discipline that a caught exception should |
void |
timingm(String message)
Enabled: Public interface methods that accept classes are the names of the boolean fields, with 'm' appended (to denote 'method'). |
void |
timingm(String message,
Object o)
Enabled: These methods take an Object in addition to a string. |
(package private) static void |
touch()
Invoking this method causes this class to be loaded, which causes all the static trace objects to be defined. |
void |
usagem(String message)
Enabled: |
void |
usagem(String message,
Object o)
Enabled: |
void |
verbosem(String message)
Enabled: |
void |
verbosem(String message,
Object o)
Enabled: |
void |
warningm(String message)
Enabled: |
void |
warningm(String message,
Object o)
Enabled: |
void |
worldm(String message)
Enabled: |
void |
worldm(String message,
Object o)
Enabled: |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final boolean ON
public boolean error
public boolean warning
public boolean world
public boolean usage
public boolean event
public boolean debug
public boolean verbose
public boolean timing
public static final Trace comm
public static final Trace captp
public static final Trace wire
public static final Trace tunnel
public static final Trace dgc
public static final Trace pumpkin
public static final Trace eruntime
public static final Trace causality
public static final Trace startup
public static final Trace entropy
public static final Trace timers
public static final Trace trace
public static final Trace console
TraceSubsystemMediator myMediator
private final String mySubsystem
private static final Object synchronizationObject
public static final String version
public static final int LOG
public static final int TRACE
public static final int NUM_ACCEPTORS
public static final String[] acceptorNames
public static final int ERROR
public static final int WARNING
public static final int WORLD
public static final int USAGE
public static final int EVENT
public static final int DEBUG
public static final int VERBOSE
public static final int MAX_THRESHOLD
public static final int TIMING
public static final int FROM_DEFAULT
public static final int FOR_SUBSYSTEM
public static final String[] reasonNames
public static final int STARTING_TRACE_BUFFER_SIZE
public static final int STARTING_TRACE_THRESHOLD
public static final long STARTING_LOG_SIZE_THRESHOLD
public static final long SMALLEST_LOG_SIZE_THRESHOLD
public static final int STARTING_LOG_THRESHOLD
public static final boolean STARTING_LOG_WRITE
public static final int IRRELEVANT
public static final int ADD
public static final int OVERWRITE
public static final int STARTING_LOG_BACKUP_ACTION
public static final File STARTING_LOG_DIR
public static final String STARTING_LOG_TAG
public static final String LOG_EXTENSION
public static final String DEFAULT_NAME
public static final String UNLIMITED_NAME
Constructor Detail |
public Trace(String subsystem)
Method Detail |
public void $(String message)
public static String arrayToString(Object[] a, String name, String pre, String sep, String post)
a
- the string.name
- string to prepend to the array.pre
- string to prepend to an element.sep
- string to separate elements.post
- string to append to an element.public void debugm(String message)
public void debugm(String message, Object o)
public void errorm(String message)
public void errorm(String message, int bugNumber)
public void errorm(String message, Object o)
public void errorm(String message, Object o, int bugNumber)
public void eventm(String message)
public void eventm(String message, Object o)
public void fatalError(String message)
message
- The error message to die withpublic void notifyFatal()
The work is done by the TraceController static object. This method is a convenience for code that doesn't import TraceController.
public void notifyOptional()
The work is done by the TraceController static object. This method is a convenience for code that doesn't import TraceController.
private void recordTraceMessageXyzzY(String message, int level, Object o, boolean noNotify)
public void setTraceMode(String mode)
public void shred(Throwable ex, String reason)
1) be rethrown
2) cause another exception to be thrown instead
3) be ignored, in a traceable way, for some stated reason
Only by making #3 explicit can we distinguish it from accidentally ignoring the exception. An exception should, therefore, only be ignored by asking a Trace object to shred it. This request carries a string that justifies allowing the program to continue normally following this event. As shredded exceptions will likely be symptoms of bugs, one will be able to have them traced.
The reason for the shredding is logged at verbose level.
public void timingm(String message)
public void timingm(String message, Object o)
static void touch()
public void usagem(String message)
public void usagem(String message, Object o)
public void verbosem(String message)
public void verbosem(String message, Object o)
public void warningm(String message)
public void warningm(String message, Object o)
public void worldm(String message)
public void worldm(String message, Object o)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |