Class symantec.itools.lang.Debug
All Packages Class Hierarchy This Package Previous Next Index
Class symantec.itools.lang.Debug
Object
|
+----symantec.itools.lang.Debug
- public class Debug
- extends Object
Provides a single debug log file to be used by any number of
classes.
- Version:
- 1.0, 07/01/1998
- Author:
- D'Arcy Smith
- Since:
- VCafe 2.1a
-
OSName
- The value of the system property "os.name";
-
OSPlatform
- The value of the system property "os.arch";
-
OSVersion
- The value of the system property "os.version";
-
writer
- The PrintWriter used for output.
-
symantec.itools.lang.Debug()
- Constructor - this should not be called...
-
finish()
- Finish writing the debug log.
-
getLineNumber()
- Get the current line number
This has only been tested with the Sun JDK 1.1.5 and VCafe JDK 1.1.4
on Windows.
-
setWriter(String, Object, String)
- Set the file name to write the debug log to
-
setWriter(URL, Object, String)
- Set the url to write the debug log to
-
setWriter(File, Object, String)
- Set the file to write the debug log to
-
setWriter(OutputStream, Object, String)
- Set the stream to write the debug log to
-
setWriter(Writer, Object, String)
- Set the writer to write the debug log to.
-
write(String)
- Write out a debug message
-
write(Object, long, String)
- Write out a debug message
-
write(Object, long, String, String)
- Write out a debug message
-
write(Object, long, Throwable)
- Write out a debug message
OSName
protected static java.lang.String OSName
- The value of the system property "os.name";
OSPlatform
protected static java.lang.String OSPlatform
- The value of the system property "os.arch";
OSVersion
protected static java.lang.String OSVersion
- The value of the system property "os.version";
writer
protected static java.io.PrintWriter writer
- The PrintWriter used for output.
- See Also:
- setWriter(java.lang.String, java.lang.Object, java.lang.String), setWriter(java.net.URL, java.lang.Object, java.lang.String), setWriter(java.io.File, java.lang.Object, java.lang.String), setWriter(java.io.OutputStream, java.lang.Object, java.lang.String), setWriter(java.io.Writer, java.lang.Object, java.lang.String)
Debug
protected Debug()
- Constructor - this should not be called... it is only protected
so that Debug can be subclassed.
finish
public static synchronized void finish()
- Finish writing the debug log.
getLineNumber
public static synchronized long getLineNumber()
- Get the current line number
This has only been tested with the Sun JDK 1.1.5 and VCafe JDK 1.1.4
on Windows. I need to make use of the OS class & Java Vendor
to make it work for others (assuming they display stack traces
differently from Sun and Symantec).
setWriter
public static synchronized boolean setWriter(String fileName,
Object clazz,
String version) throws IOException
- Set the file name to write the debug log to
- Parameters:
- fileName - the file name of the debug log
- clazz - the class that had "main" called
- version - the version of clazz
- Returns:
- true if the writer was set
false if the writer already has a value
- Throws: IOException
- if any error occured attaching the log file
setWriter
public static synchronized boolean setWriter(URL url,
Object clazz,
String version) throws IOException
- Set the url to write the debug log to
- Parameters:
- url - the url of the debug log
- clazz - the class that had "main" called
- version - the version of clazz
- Returns:
- true if the writer was set
false if the writer already has a value
- Throws: IOException
- if any error occured attaching the log file
setWriter
public static synchronized boolean setWriter(File file,
Object clazz,
String version) throws IOException
- Set the file to write the debug log to
- Parameters:
- file - the file of the debug log
- clazz - the class that had "main" called
- version - the version of clazz
- Returns:
- true if the writer was set
false if the writer already has a value
- Throws: IOException
- if any error occured attaching the log file
setWriter
public static synchronized boolean setWriter(OutputStream stream,
Object clazz,
String version)
- Set the stream to write the debug log to
- Parameters:
- stream - the stream of the debug log
- clazz - the class that had "main" called
- version - the version of clazz
- Returns:
- true if the writer was set
false if the writer already has a value
- Throws: IOException
- if any error occured attaching the log file
setWriter
public static synchronized boolean setWriter(Writer w,
Object clazz,
String version)
- Set the writer to write the debug log to.
If the writer (of the class - not the param)
is null then the log will be assigned.
- Parameters:
- writer - the writer of the debug log
- clazz - the class that had "main" called
- version - the version of clazz
- Returns:
- true if the writer was set
false if the writer already has a value
- Throws: IOException
- if any error occured attaching the log file
write
public static synchronized void write(String msg)
- Write out a debug message
- Parameters:
- msg - the message to write
write
public static synchronized void write(Object src,
long line,
String msg)
- Write out a debug message
- Parameters:
- src - an instance of the class where the message is coming from
- msg - the message to write
write
public static synchronized void write(Object src,
long line,
String action,
String result)
- Write out a debug message
- Parameters:
- src - an instance of the class where the message is coming from
- action - the action that is being reported
- result - the reult of the action
write
public static synchronized void write(Object src,
long line,
Throwable ex)
- Write out a debug message
- Parameters:
- src - an instance of the class where the message is coming from
- ex - the exception that was thrown
All Packages Class Hierarchy This Package Previous Next Index