|
© 2005 BEA Systems, Inc. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bea.commerce.ebusiness.discount.util.Log
This class provides some very simple logging interfaces. Everything is static, so just call Log.info(), etc. All static methods for this Singleton service.
Field Summary | |
static boolean |
consoleMode
flag for logging to console in addition to log file |
static String |
logDir
Directory holding log output |
static String |
logFile
The name of the file holding log output |
static PrintWriter |
logWriter
output for stderr console logging |
static PrintWriter |
stderrWriter
output for stderr console logging |
static PrintWriter |
stdoutWriter
output for stdout console logging |
static String |
T_SEP
|
Constructor Summary | |
Log()
|
Method Summary | |
static void |
clearConsole()
Sets the consoleMode flag to false stopping logging to the tty. |
static String |
currentTime()
|
static void |
debug(Object o,
String s)
Sends string (prepended with class name) to debug log with newline |
static void |
debug(String s)
Sends string to debug log with newline |
static void |
debug(String s,
boolean newline)
Sends string to debug log with optional newline |
static void |
debug(Throwable e)
Prints a stackTrace for the given exception to error log |
static void |
error(Object o,
String s)
Sends string (prepended with class name) to error log with newline |
static void |
error(String s)
Sends string to error log with newline |
static void |
error(String s,
boolean newline)
Sends string to error log with optional newline |
static void |
error(Throwable e)
Prints a stackTrace for the given exception to error log |
static void |
exception(Throwable e)
Prints a stackTrace for the given exception to error log |
static void |
fatal(String s,
int exitVal)
WARNING: calls System.exit() to kill the VM |
static void |
fatal(Throwable e,
int exitVal)
WARNING: calls System.exit() to kill the VM |
static PrintWriter |
getPrintWriter()
Synchronize on this writer if used in a multi-threaded environment. |
static String |
getStackTrace(Throwable e)
|
static PrintWriter |
getStderrWriter()
Synchronize on this writer if used in a multi-threaded environment. |
static PrintWriter |
getStdoutWriter()
Synchronize on this writer if used in a multi-threaded environment. |
static void |
info(String s)
Sends string to info log with newline |
static void |
info(String s,
boolean newline)
Sends string to info log with optional newline |
static void |
printCurrentTime(PrintWriter out)
|
static void |
printCurrentTime(PrintWriter out,
boolean showThread)
|
static long |
profileFinish(String taskName,
long startTime)
Logs the start, finished, and elapsed time for the given task For example, long startTime = Log.profileStart(); ...do some stuff... |
static long |
profileFinish(String taskName,
long startTime,
long finishTime,
boolean verbose)
|
static long |
profileStart()
|
static void |
setConsole()
Sets the console flag to true causing all logging to be sent to the tty |
static void |
setConsole(boolean value)
Sets the consoleMode flag controlling logging to the tty. |
static PrintWriter |
setPrintWriter(PrintWriter writer)
Synchronize on this writer if used in a multi-threaded environment. |
static void |
stackTrace()
Prints a stackTrace marking the current stack to error log |
static void |
warn(String s)
Sends string to warn log with newline |
static void |
warn(String s,
boolean newline)
Sends string to warn log with optional newline |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static boolean consoleMode
public static String logDir
public static String logFile
public static PrintWriter logWriter
public static PrintWriter stderrWriter
public static PrintWriter stdoutWriter
public static final String T_SEP
Constructor Detail |
public Log()
Method Detail |
public static void clearConsole()
public static String currentTime()
public static void debug(Object o, String s)
public static void debug(String s)
public static void debug(String s, boolean newline)
public static void debug(Throwable e)
public static void error(Object o, String s)
public static void error(String s)
public static void error(String s, boolean newline)
public static void error(Throwable e)
public static void exception(Throwable e)
public static void fatal(String s, int exitVal)
public static void fatal(Throwable e, int exitVal)
public static PrintWriter getPrintWriter()
public static String getStackTrace(Throwable e)
public static PrintWriter getStderrWriter()
public static PrintWriter getStdoutWriter()
public static void info(String s)
public static void info(String s, boolean newline)
public static void printCurrentTime(PrintWriter out)
public static void printCurrentTime(PrintWriter out, boolean showThread)
public static long profileFinish(String taskName, long startTime)
long startTime = Log.profileStart(); ...do some stuff... Log.profileFinish("MyApp.TaskName", startTime);
taskName
- A short name for the task -- no spacesstartTime
- from profileStartpublic static long profileFinish(String taskName, long startTime, long finishTime, boolean verbose)
public static long profileStart()
public static void setConsole()
public static void setConsole(boolean value)
public static PrintWriter setPrintWriter(PrintWriter writer)
public static void stackTrace()
public static void warn(String s)
public static void warn(String s, boolean newline)
|
© 2005 BEA Systems, Inc. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |