org.javagroups.log
Class Trace

java.lang.Object
  |
  +--org.javagroups.log.Trace

public class Trace
extends java.lang.Object

Provides timestamped logging to files, streams, writers, and sockets at differing levels of verbosity. Log outputs are associated with a module name (see this package's description) and a trace level.

Since tracing statements create a lot of strings, even when tracing is disabled, a trace statement should always be conditional, e.g. if(Trace.trace) Trace.info("UDP.run()", "bla"). Thus, if tracing is disabled, the strings won't be created. For trace statements that should always be printed, we don't need to make the trace statement conditional. Note that, if trace statements should be removed in the production code, we can use the Trace.debug flag, e.g. if(Trace.debug) Trace(...). If Trace.debug is set to false when the code is compiled, the entire statement will not be added to the generated classfile.

A simple example of using Trace:

 // Send all WARN and higher messages to /tmp/logfile for MyClass
 Trace.setOutput("MyClass", Trace.WARN, "/tmp/logfile");

 // Send all messages to /tmp/AnotherClass_DEBUG for AnotherClass
 Trace.setOutput("AnotherClass", Trace.DEBUG, "/tmp");

 // Printed to /tmp/logfile because FATAL > WARN
 Trace.println("MyClass", Trace.FATAL, "help!");

 // Not printed because DEBUG < WARN (the current level for MyClass)
 Trace.println("MyClass", Trace.DEBUG, "blah, blah");

 // Printed to /tmp/AnotherClass_DEBUG because of the
 // "module inheritance" rules (see package overview).
 Trace.println("AnotherClass.myMethod()", Trace.DEBUG, "bletch");

 // Close the outputs separately. Could also call Trace.closeAllOutputs()
 Trace.closeOutput("MyClass");
 Trace.closeOutput("AnotherClass");
 

For a more complete discussion of module names and the rules used to find the output associated with a module, see the Description section of the overview for this package.

Author:
Jim Menard, jimm@io.com

Field Summary
static boolean copy
          Used to determine whether to copy messages (copy=true) in retransmission tables, or whether to use references (copy=false).
static boolean debug
          Allows for conditional compilation, e.g.
static int DEBUG
          The trace level for all messages.
protected static java.lang.String DEFAULT_OUTPUT
           
protected static java.lang.String DEFAULT_OUTPUT_FILE_NAME
          The file name used when setting a new default output and when the file name specified is a directory.
protected static java.lang.String DEFAULT_OUTPUT_STMT
           
protected static Tracer defaultTracer
          The default tracer to use when a message is not destined for any particular output.
static int ERROR
          The trace level for all ERROR and FATAL messages.
static int FATAL
          The trace level for only FATAL messages.
protected static java.lang.String FILE_SEPARATOR
          The character used to denote directories (e.g.
protected static java.lang.String identifier
          Used to e.g.
static int INFO
          The trace level for all messages except DEBUG and TEST.
protected static java.lang.String NEWLINE
          The newline string used in println.
protected static java.lang.String STDERR_STMT
           
protected static Tracer[] STDERRS
          We initially create Tracers for each STDERR level
protected static java.lang.String STDOUT_STMT
           
protected static Tracer[] STDOUTS
          We initially create Tracers for each STDOUT level
static int TEST
          The trace level for all messages except DEBUG.
protected static java.lang.String TIMESTAMP_FORMAT_STMT
           
static boolean trace
          Users of Trace can check this flag to determine whether to trace.
protected static java.lang.String TRACE_STMT
           
protected static java.util.HashMap TRACERS
          Maps module names to Tracers.
static int WARN
          The trace level for all WARN, ERROR, and FATAL messages.
 
Method Summary
static void addTracer(java.lang.String module, Tracer tracer)
          Associates the specified module name with a Tracer.
protected static boolean bogusModuleName(java.lang.String module)
          Returns true if the specified module name is illegal.
static void closeAllOutputs()
          Closes all outputs for all modules.
static void closeDefaultOutput()
          Closes the current default output.
static void closeOutput(java.lang.String module)
          Closes the output for the specified module.
static void debug(java.lang.String module, java.lang.String message)
          Helper method.
static void error(java.lang.String module, java.lang.String message)
          Helper method.
static void fatal(java.lang.String module, java.lang.String message)
          Helper method.
protected static Tracer findTracerFor(java.lang.String module)
          Returns the Tracer to be used for output for the specified module name.
static void flushAllOutputs()
          Flushes all output for all modules.
static void flushOutput(java.lang.String module)
          Flushes all output for the specified module.
static void flushStderrs()
           
static void flushStdouts()
           
protected static Tracer getDefaultTracer()
          Returns the default Tracer to be used when no other appropriate one is found.
static java.lang.String getStackTrace(java.lang.Throwable x)
          Converts an exception stack trace into a java.lang.String
static Tracer getStderrTracer(int level)
           
static Tracer getStdoutTracer(int level)
           
static void info(java.lang.String module, java.lang.String message)
          Helper method.
static void init()
          Same as init(String fname), but looks in user's home directory then in CLASSPATH for javagroups.properties.
static void init(java.lang.String fname)
           
protected static Tracer lookup(java.lang.String module)
          Returns the Tracer that matches the specified module name.
protected static java.lang.String makeOutputFileName(java.lang.String module, int level)
          Returns a file name created from a module name and trace level.
protected static java.lang.String moduleLookupName(java.lang.String module)
          Returns the string to be used to store and look up the specified module.
protected static void parse(java.lang.String key, java.lang.String val)
           
protected static void parseDefaultOutput(java.lang.String val)
           
protected static void parseTimestampFormat(java.lang.String val)
           
protected static void parseTrace(java.lang.String val)
          Format is .
static void print(java.lang.String module, int level, java.lang.String message)
          Finds the appropriate output for the specified module and sends message to it.
static void print(java.lang.String module, int level, java.lang.String identifier, java.lang.String message)
          Prints the identifier (e.g.
static void println(java.lang.String module, int level, java.lang.String message)
          Appends a line separator to message and calls print.
protected static void removeTracer(java.lang.String module)
          Removes the Tracer for the specified module.
static void restoreDefaultOutput()
          Sets the default output back to its original value, STDOUT.
static void setAutoFlush(java.lang.String module, boolean auto)
          Sets the auto-flush flag for the specified module's output.
static void setAutoFlushAll(boolean auto)
          Sets the auto-flush flag for all outputs.
static void setAutoFlushDefault(boolean auto)
          Sets the auto-flush flag for the current default output.
static void setAutoFlushForAllStderrs(boolean auto)
           
static void setAutoFlushForAllStdouts(boolean auto)
           
static void setDefaultOutput(java.net.InetAddress addr, int port)
          Sets the default output to the socket at addr on port.
static void setDefaultOutput(int level, java.net.InetAddress addr, int port)
          Sets the default output to the socket at addr on port at the specified trace level.
static void setDefaultOutput(int level, java.io.PrintStream outputStream)
          Sets the default output to the specified PrintStream and trace level.
static void setDefaultOutput(int level, java.io.PrintWriter writer)
          Sets the default output to the specified PrintWriter and trace level.
static void setDefaultOutput(int level, java.lang.String fileName)
          Sets the default output to the specified file and trace level.
static void setDefaultOutput(int level, java.lang.String host, int port)
          Sets the default output to the socket at host on port with the given trace level.
static void setDefaultOutput(java.io.PrintStream outputStream)
          Sets the default output to the specified PrintStream.
static void setDefaultOutput(java.io.PrintWriter writer)
          Sets the default output to the specified PrintWriter.
static void setDefaultOutput(java.lang.String fileName)
          Sets the default output to the specified file.
static void setDefaultOutput(java.lang.String host, int port)
          Sets the default output to the socket at host on port.
static void setIdentifier(java.lang.String id)
           
static void setOutput(java.lang.String module, int level)
          Changes the trace level for module.
static void setOutput(java.lang.String module, int level, java.net.InetAddress addr, int port)
          Sends a module's output to the socket at addr on port.
static void setOutput(java.lang.String module, int level, java.io.PrintStream outputStream)
          Sends a module's output to the specified PrintStream.
static void setOutput(java.lang.String module, int level, java.io.PrintWriter writer)
          Sends a module's output to the specified PrintWriter.
static void setOutput(java.lang.String module, int level, java.lang.String fileName)
          Sends a module's output to the specified file.
static void setOutput(java.lang.String module, int level, java.lang.String host, int port)
          Sends a module's output to the socket at host on port.
static void setTimestampFormat(java.lang.String format)
          Set the timestamp format.
static void setTrace(boolean t)
           
protected static int string2Level(java.lang.String l)
           
static void test(java.lang.String module, java.lang.String message)
          Helper method.
static void warn(java.lang.String module, java.lang.String message)
          Helper method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

trace

public static boolean trace
Users of Trace can check this flag to determine whether to trace. Example:
        if(Trace.trace)
        Trace.info("UDP.run()", "sending message");
        


debug

public static final boolean debug
Allows for conditional compilation, e.g. if(Trace.debug) Trace.info(...) would be removed from the code (if recompiled) when this flag is set to false. Therefore, code that should be removed from the final product should use if(Trace.debug) rather than if(Trace.trace).

See Also:
Constant Field Values

copy

public static final boolean copy
Used to determine whether to copy messages (copy=true) in retransmission tables, or whether to use references (copy=false). Once copy=false has worked for some time, this flag will be removed entirely

See Also:
Constant Field Values

DEBUG

public static final int DEBUG
The trace level for all messages.

See Also:
Constant Field Values

TEST

public static final int TEST
The trace level for all messages except DEBUG.

See Also:
Constant Field Values

INFO

public static final int INFO
The trace level for all messages except DEBUG and TEST.

See Also:
Constant Field Values

WARN

public static final int WARN
The trace level for all WARN, ERROR, and FATAL messages.

See Also:
Constant Field Values

ERROR

public static final int ERROR
The trace level for all ERROR and FATAL messages.

See Also:
Constant Field Values

FATAL

public static final int FATAL
The trace level for only FATAL messages.

See Also:
Constant Field Values

DEFAULT_OUTPUT_FILE_NAME

protected static final java.lang.String DEFAULT_OUTPUT_FILE_NAME
The file name used when setting a new default output and when the file name specified is a directory.

See Also:
Constant Field Values

TRACE_STMT

protected static final java.lang.String TRACE_STMT
See Also:
Constant Field Values

DEFAULT_OUTPUT_STMT

protected static final java.lang.String DEFAULT_OUTPUT_STMT
See Also:
Constant Field Values

TIMESTAMP_FORMAT_STMT

protected static final java.lang.String TIMESTAMP_FORMAT_STMT
See Also:
Constant Field Values

STDOUT_STMT

protected static final java.lang.String STDOUT_STMT
See Also:
Constant Field Values

STDERR_STMT

protected static final java.lang.String STDERR_STMT
See Also:
Constant Field Values

DEFAULT_OUTPUT

protected static final java.lang.String DEFAULT_OUTPUT
See Also:
Constant Field Values

TRACERS

protected static final java.util.HashMap TRACERS
Maps module names to Tracers.


STDOUTS

protected static final Tracer[] STDOUTS
We initially create Tracers for each STDOUT level


STDERRS

protected static final Tracer[] STDERRS
We initially create Tracers for each STDERR level


defaultTracer

protected static Tracer defaultTracer
The default tracer to use when a message is not destined for any particular output. May be null; defaults to null.


NEWLINE

protected static final java.lang.String NEWLINE
The newline string used in println. This is the system property line.separator, and is not necessarily the newline character ('\n').

See Also:
println(java.lang.String, int, java.lang.String)

FILE_SEPARATOR

protected static final java.lang.String FILE_SEPARATOR
The character used to denote directories (e.g. "/" in UNIX and '\' in Windows


identifier

protected static java.lang.String identifier
Used to e.g. identify the process which uses Trace. There might be multiple processes using the same log files.

Method Detail

init

public static void init(java.lang.String fname)
                 throws java.io.IOException,
                        java.lang.SecurityException
Parameters:
fname - Fully qualified name of property file. If it is a directory, "/javagroups.properties" will be appended to the directory name.
Throws:
java.io.IOException
java.lang.SecurityException

init

public static void init()
Same as init(String fname), but looks in user's home directory then in CLASSPATH for javagroups.properties. Won't complain if not found.


getStdoutTracer

public static Tracer getStdoutTracer(int level)

flushStdouts

public static void flushStdouts()

setAutoFlushForAllStdouts

public static void setAutoFlushForAllStdouts(boolean auto)

getStderrTracer

public static Tracer getStderrTracer(int level)

flushStderrs

public static void flushStderrs()

setAutoFlushForAllStderrs

public static void setAutoFlushForAllStderrs(boolean auto)

setIdentifier

public static void setIdentifier(java.lang.String id)

setTrace

public static void setTrace(boolean t)

setOutput

public static void setOutput(java.lang.String module,
                             int level)
Changes the trace level for module. The output destination is not changed. No other module (either higher or lower in the module "inheritance chain") is affected. If this module has no output associated with it (and thus any output would go to the current default output), nothing happens. If the module name is not well-formed, nothing happens.

Parameters:
module - a module name
level - a trace level

setOutput

public static void setOutput(java.lang.String module,
                             int level,
                             java.lang.String fileName)
                      throws java.io.IOException
Sends a module's output to the specified file. Output is only sent when a call to print or println specifies a trace level >= level.

If fileName is the name of a directory, a file name will be generated using module and level (see

Parameters:
module - a module name
level - a trace level
fileName - a file or directory name
Throws:
java.io.IOException - when a FileWriter can not be created

setOutput

public static void setOutput(java.lang.String module,
                             int level,
                             java.io.PrintStream outputStream)
Sends a module's output to the specified PrintStream. Output is only sent when a call to print or println specifies a trace level >= level.

The most common values of outputStream will be System.out or System.err. In fact, that is so likely that we keep pre-generated outputs around for those two and return one when outputStream is one of those two values.

Parameters:
module - a module name
level - a trace level
outputStream - a PrintStream

setOutput

public static void setOutput(java.lang.String module,
                             int level,
                             java.io.PrintWriter writer)
Sends a module's output to the specified PrintWriter. Output is only sent when a call to print or println specifies a trace level >= level.

Parameters:
module - a module name
level - a trace level
writer - a PrintWriter

setOutput

public static void setOutput(java.lang.String module,
                             int level,
                             java.lang.String host,
                             int port)
                      throws java.net.UnknownHostException,
                             java.io.IOException
Sends a module's output to the socket at host on port. As with the Socket class, if port is zero then the first available port will be used. Output is only sent when a call to print or println specifies a trace level >= level.

Parameters:
module - a module name
level - a trace level
host - the name of a host machine
port - a port number
Throws:
java.net.UnknownHostException - if host can not be resolved
java.io.IOException - if an I/O error occurs when creating a socket
See Also:
Socket

setOutput

public static void setOutput(java.lang.String module,
                             int level,
                             java.net.InetAddress addr,
                             int port)
                      throws java.io.IOException
Sends a module's output to the socket at addr on port. As with the Socket class, if port is zero then the first available port will be used. Output is only sent when a call to print or println specifies a trace level >= level.

Parameters:
module - a module name
level - a trace level
addr - an InetAddress
port - a port number
Throws:
java.io.IOException - if an I/O error occurs when creating a socket
See Also:
Socket

closeOutput

public static void closeOutput(java.lang.String module)
Closes the output for the specified module. When the output is closed, it flushes its output first. It's OK to call this for modules that are using STDOUT, STDERR, or the default output.

Parameters:
module - a module name

closeAllOutputs

public static void closeAllOutputs()
Closes all outputs for all modules. When an output is closed, it flushes its output first.


flushOutput

public static void flushOutput(java.lang.String module)
Flushes all output for the specified module.

Parameters:
module - a module name

flushAllOutputs

public static void flushAllOutputs()
Flushes all output for all modules.


setAutoFlush

public static void setAutoFlush(java.lang.String module,
                                boolean auto)
Sets the auto-flush flag for the specified module's output.

Parameters:
module - a module name
auto - if true auto-flushing is turned on

setAutoFlushAll

public static void setAutoFlushAll(boolean auto)
Sets the auto-flush flag for all outputs.

The auto-flush value for STDOUT and STDERR are also set.

Parameters:
auto - if true auto-flushing is turned on

setAutoFlushDefault

public static void setAutoFlushDefault(boolean auto)
Sets the auto-flush flag for the current default output.

Parameters:
auto - if true auto-flushing is turned on

print

public static void print(java.lang.String module,
                         int level,
                         java.lang.String message)
Finds the appropriate output for the specified module and sends message to it. When looking for which output to use, the following set of rules are used. If no output is found (the returned output is null), then nothing is printed.
  1. If the module name contains no method name (there are no parenthesis), look for the output associated with this module name. If found, return it. Else, return the default output (initially null).
  2. Look for the output associated with this module and method name, excluding arguments if any.
  3. Strip off the method name and look for the output associated with the class name.
  4. Use the default output (initially null).

Parameters:
module - a module name
level - a trace level
message - the string to be output

print

public static void print(java.lang.String module,
                         int level,
                         java.lang.String identifier,
                         java.lang.String message)
Prints the identifier (e.g. process name) after the level, before the message.


println

public static void println(java.lang.String module,
                           int level,
                           java.lang.String message)
Appends a line separator to message and calls print. The system property "line.separator" is used; this is not necessarily a single newline character ('\n').

Parameters:
module - a module name
level - a trace level
message - the string to be output
See Also:
print(java.lang.String, int, java.lang.String)

debug

public static void debug(java.lang.String module,
                         java.lang.String message)
Helper method. Will call Trace.println(module, Trace.DEBUG, module)


test

public static void test(java.lang.String module,
                        java.lang.String message)
Helper method. Will call Trace.println(module, Trace.TEST, module)


info

public static void info(java.lang.String module,
                        java.lang.String message)
Helper method. Will call Trace.println(module, Trace.INFO, module)


warn

public static void warn(java.lang.String module,
                        java.lang.String message)
Helper method. Will call Trace.println(module, Trace.WARN, module)


error

public static void error(java.lang.String module,
                         java.lang.String message)
Helper method. Will call Trace.println(module, Trace.ERROR, module)


fatal

public static void fatal(java.lang.String module,
                         java.lang.String message)
Helper method. Will call Trace.println(module, Trace.FATAL, module)


setTimestampFormat

public static void setTimestampFormat(java.lang.String format)
Set the timestamp format. The format string is that used by SimpleDateFormat. If format is null, then the ISO 8601 date format ("CCYY-MM-DDThh:mm:ss,s") is used.


getDefaultTracer

protected static Tracer getDefaultTracer()
Returns the default Tracer to be used when no other appropriate one is found. May be null

Returns:
the default Tracer (defaultTracer); may be null
See Also:
Tracer

restoreDefaultOutput

public static void restoreDefaultOutput()
Sets the default output back to its original value, STDOUT.


closeDefaultOutput

public static void closeDefaultOutput()
Closes the current default output. All output with no other destination is ignored.


setDefaultOutput

public static void setDefaultOutput(int level,
                                    java.lang.String fileName)
                             throws java.io.IOException
Sets the default output to the specified file and trace level. If fileName is the name of a directory, the file name DEFAULT_OUTPUT_FILE_NAME ("default.out") is used.

If the file does not exist, it is created. If the file does exist, the file is opened for appending.

Parameters:
fileName - a file or directory name
Throws:
java.io.IOException - when a FileWriter can not be created

setDefaultOutput

public static void setDefaultOutput(java.lang.String fileName)
                             throws java.io.IOException
Sets the default output to the specified file. If fileName is the name of a directory, the file name DEFAULT_OUTPUT_FILE_NAME ("default.out") is used.

If the file does not exist, it is created. If the file does exist, the file is opened for appending.

Parameters:
fileName - a file or directory name
Throws:
java.io.IOException - when a FileWriter can not be created

setDefaultOutput

public static void setDefaultOutput(int level,
                                    java.io.PrintStream outputStream)
Sets the default output to the specified PrintStream and trace level.

The most common values of outputStream will be System.out or System.err. In fact, that is so likely that we keep pre-generated outputs around for those two and return one when outputStream is one of those two values.

Parameters:
outputStream - a PrintStream

setDefaultOutput

public static void setDefaultOutput(java.io.PrintStream outputStream)
Sets the default output to the specified PrintStream.

The most common values of outputStream will be System.out or System.err. In fact, that is so likely that we keep pre-generated outputs around for those two and return one when outputStream is one of those two values.

Parameters:
outputStream - a PrintStream

setDefaultOutput

public static void setDefaultOutput(int level,
                                    java.io.PrintWriter writer)
Sets the default output to the specified PrintWriter and trace level.

Parameters:
writer - a PrintWriter

setDefaultOutput

public static void setDefaultOutput(java.io.PrintWriter writer)
Sets the default output to the specified PrintWriter.

Parameters:
writer - a PrintWriter

setDefaultOutput

public static void setDefaultOutput(int level,
                                    java.lang.String host,
                                    int port)
                             throws java.net.UnknownHostException,
                                    java.io.IOException
Sets the default output to the socket at host on port with the given trace level. As with the Socket class, if port is zero then the first available port will be used.

Parameters:
host - the name of a host machine
port - a port number
Throws:
java.net.UnknownHostException - if host can not be resolved
java.io.IOException - if an I/O error occurs when creating a socket
See Also:
Socket

setDefaultOutput

public static void setDefaultOutput(java.lang.String host,
                                    int port)
                             throws java.net.UnknownHostException,
                                    java.io.IOException
Sets the default output to the socket at host on port. As with the Socket class, if port is zero then the first available port will be used.

Parameters:
host - the name of a host machine
port - a port number
Throws:
java.net.UnknownHostException - if host can not be resolved
java.io.IOException - if an I/O error occurs when creating a socket
See Also:
Socket

setDefaultOutput

public static void setDefaultOutput(int level,
                                    java.net.InetAddress addr,
                                    int port)
                             throws java.io.IOException
Sets the default output to the socket at addr on port at the specified trace level. As with the Socket class, if port is zero then the first available port will be used.

Parameters:
addr - an InetAddress
port - a port number
Throws:
java.io.IOException - if an I/O error occurs when creating a socket
See Also:
Socket

setDefaultOutput

public static void setDefaultOutput(java.net.InetAddress addr,
                                    int port)
                             throws java.io.IOException
Sets the default output to the socket at addr on port. As with the Socket class, if port is zero then the first available port will be used.

Parameters:
addr - an InetAddress
port - a port number
Throws:
java.io.IOException - if an I/O error occurs when creating a socket
See Also:
Socket

addTracer

public static void addTracer(java.lang.String module,
                             Tracer tracer)
Associates the specified module name with a Tracer.

Parameters:
module - a module name
tracer - a Tracer
See Also:
Tracer

removeTracer

protected static void removeTracer(java.lang.String module)
Removes the Tracer for the specified module. Does not close or otherwise modify the Tracer.

Parameters:
module - a module name
See Also:
Tracer

lookup

protected static Tracer lookup(java.lang.String module)
Returns the Tracer that matches the specified module name. No rule matching is done; if the module name as returned by moduleLookupName is not found, null is returned. This method is called from setOutput but not from print.

Parameters:
module - a module name
Returns:
the Tracer associated with this module, or null if not found
See Also:
Tracer, findTracerFor(java.lang.String)

moduleLookupName

protected static java.lang.String moduleLookupName(java.lang.String module)
Returns the string to be used to store and look up the specified module. The string returned is a copy of module with everything after first parenthesis chopped off. The first parenthesis is kept. This method is called from setOutput but not from print.

Keeping the parenthesis helps us distinguish between modules that have method names in them and fully qualified class names. As an admittedly artificial example, the module named "Foo.Method()" would be distinguishable from a class whose name is Method and full path is "Foo.Method".

Parameters:
module - a module name
Returns:
a copy of the module name suitable for Tracer lookup and storage
See Also:
Tracer

findTracerFor

protected static Tracer findTracerFor(java.lang.String module)
Returns the Tracer to be used for output for the specified module name. Performs a series of searches described in the comment for print. May return null, if no match is found and getDefaultTracer returns null. This method is called from print, and is not called from setOutput.

Parameters:
module - a module name
Returns:
a Tracer or null if there are no matches and the default tracer is null
See Also:
Tracer, lookup(java.lang.String), getDefaultTracer()

makeOutputFileName

protected static java.lang.String makeOutputFileName(java.lang.String module,
                                                     int level)
Returns a file name created from a module name and trace level. The file name is of the form "module_LEVEL", where "module" is of the form "module" or "module.method" without any parenthesis, and "LEVEL" is a string like "DEBUG" or "FATAL". The returned value is not a full path, just a string suitable for use as a file name.

Parameters:
module - a module name
level - a trace level (DEBUG, FATAL, etc.)
Returns:
a string created from the module name and trace level, suitable for use as a file name

bogusModuleName

protected static boolean bogusModuleName(java.lang.String module)
Returns true if the specified module name is illegal. Currently only checks to see that if the name contains '(' that there is a '.' before it.

Parameters:
module - a module name
Returns:
true if the specified module name is illegal, else returns false

parse

protected static void parse(java.lang.String key,
                            java.lang.String val)

parseTrace

protected static void parseTrace(java.lang.String val)
Format is . Argument is guaranteed not to be null


parseDefaultOutput

protected static void parseDefaultOutput(java.lang.String val)

parseTimestampFormat

protected static void parseTimestampFormat(java.lang.String val)

string2Level

protected static int string2Level(java.lang.String l)

getStackTrace

public static java.lang.String getStackTrace(java.lang.Throwable x)
Converts an exception stack trace into a java.lang.String

Parameters:
x - an exception
Returns:
a string containg the stack trace, null if the exception parameter was null


Copyright ? 2001,2002 www.javagroups.com . All Rights Reserved.