|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.util.LogUtil
public class LogUtil
Class LogUtil
| Nested Class Summary | |
|---|---|
static interface |
LogUtil.DialogManager
DialogManager is an interface that allows an applcation to add its own buttons to the error dialogs |
static class |
LogUtil.LogCategory
Class LogCategory serves as a wrapper around some (undefined for now) logging facility. |
| Field Summary | |
|---|---|
static int |
printlncnt
Helps to track down println calls |
| Method Summary | |
|---|---|
static void |
addMessageLogger(JLabel t)
Add the given component into the list of components that show messages from the message method calls |
static void |
addMessageLogger(JTextArea t)
Add the given component into the list of components that show messages from the message method calls |
static boolean |
anyErrors()
If we are in test mode have there been any errors logged. |
static void |
clearMessage(String message)
If the given message is the same as the last shown message then clear all messages |
static void |
configure()
Configure the logging |
static void |
consoleMessage(String msg)
Append the given msg to the console text area. |
static Window |
getCurrentWindow()
Finds the most recent active window. |
static boolean |
getDebugMode()
Set the debug mode |
static List |
getExceptions()
Get the list of exceptions that were thrown when in test mode |
static Throwable |
getInnerException(Throwable exc)
Get any exception that the given exception wraps (if it does). |
static LogUtil.LogCategory |
getLogInstance(String name)
Helper that creates a log category. |
static List |
getMessages()
Get the list of messages for errors when in test mode |
static JPanel |
getMultiExceptionsPanel(List errorMessages,
List exceptions)
Create the panel that shows multiple exceptions |
static String |
getOutputBuffer(boolean andClearIt)
Get the text that has been written to stderr/stdout when in buffering mode |
static String |
getStackTrace()
Return the stack trace of this calling thread |
static String |
getStackTrace(Throwable exc)
Get the stack trace from the given exception |
static boolean |
getTestMode()
Are we in test mode |
static void |
logException(String msg,
Throwable exc)
Log the given error message and exception |
static void |
message(String msg)
Show the given string in all of the message components |
static void |
printException(LogUtil.LogCategory log_,
String xmsg,
Throwable exc)
Show the given error message/exception in the gui (if not in test mode), print it to the console and log it to the given Category |
static void |
printException(LogUtil.LogCategory log_,
String xmsg,
Throwable exc,
byte[] fileBytes)
Print the exception |
static void |
printException(LogUtil.LogCategory log_,
String xmsg,
Throwable originalException,
File file)
Print the exception |
static void |
printExceptionNoGui(LogUtil.LogCategory log_,
String xmsg,
Throwable exc)
Log the given error message/exception to the given LogCategory |
static void |
printExceptions(List exceptions)
Print out the list of exceptions |
static void |
printExceptions(List errorMessages,
List exceptions)
Print out the list of error messages and exceptions. |
static void |
printExceptions(String label,
List errorMessages,
List exceptions)
|
static void |
printExceptionsNoGui(List errorMessages,
List exceptions)
print out the list of error messages and exceptions. |
static void |
printExceptionsNoGui(String errorMessage,
List exceptions)
Print out the error messages and exceptions. |
static void |
println(String msg)
This allows you to print to stderr even when we are buffering |
static void |
printMessage(String msg)
Simply print the given message using the default logging LogCategory. |
static void |
registerWindow(Window w)
This registers a window listener on the given window to add and remove the the window to the list of active windows. |
static void |
removeMessageLogger(Object t)
Remove the given component from the list of message components |
static void |
setDebugMode(boolean v)
Set the debug mode |
static void |
setDialogManager(LogUtil.DialogManager manager)
Allows applications to add their own LogUtil.DialogManager |
static void |
setTestMode(boolean v)
Set the test mode. |
static void |
showConsole()
Create (if needed) the Console window and show it |
static void |
startOutputBuffer()
Start buffering stderr and stdout |
static void |
stopOutputBuffer()
Stop buffering stderr and stdout |
static void |
tracePrintlns()
Helps to track down println calls |
static void |
userErrorMessage(LogUtil.LogCategory log_,
String msg)
Show the error dialog to the user |
static void |
userErrorMessage(Object msg)
Show the error dialog to the user |
static void |
userErrorMessage(String msg)
Show the error dialog to the user |
static void |
userMessage(LogUtil.LogCategory log_,
String msg)
Show an informational message to the user. |
static void |
userMessage(LogUtil.LogCategory log_,
String msg,
boolean andLog)
Show an informational message to the user. |
static void |
userMessage(LogUtil.LogCategory log_,
String msg,
String consoleMsg)
Show an informational message to the user. |
static void |
userMessage(String msg)
Show an informational message to the user. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static int printlncnt
| Method Detail |
|---|
public static LogUtil.LogCategory getLogInstance(String name)
name - The name of the log instance
public static boolean anyErrors()
public static List getExceptions()
public static List getMessages()
public static void setTestMode(boolean v)
v - The test mode flagpublic static boolean getTestMode()
public static void setDebugMode(boolean v)
v - the debug flag (true to print out debug messages)public static boolean getDebugMode()
public static void configure()
public static void logException(String msg,
Throwable exc)
msg - The error messageexc - The exception
public static void printExceptionsNoGui(List errorMessages,
List exceptions)
errorMessages - exceptions -
public static void printExceptionsNoGui(String errorMessage,
List exceptions)
errorMessage - The messageexceptions - The exceptionspublic static void printExceptions(List exceptions)
exceptions - The exceptionspublic static void println(String msg)
msg - The text to printpublic static void startOutputBuffer()
public static String getOutputBuffer(boolean andClearIt)
andClearIt - Clear the buffer
public static void stopOutputBuffer()
public static void printExceptions(List errorMessages,
List exceptions)
errorMessages - The error messagesexceptions - The exceptions
public static void printExceptions(String label,
List errorMessages,
List exceptions)
public static Throwable getInnerException(Throwable exc)
exc - The possible exception containing exception
public static JPanel getMultiExceptionsPanel(List errorMessages,
List exceptions)
errorMessages - The error messagesexceptions - The exceptions
public static String getStackTrace()
public static String getStackTrace(Throwable exc)
exc - The exception to get the trace from
public static void showConsole()
public static void consoleMessage(String msg)
msg - public static void setDialogManager(LogUtil.DialogManager manager)
manager - The singleton dialog manager to usepublic static Window getCurrentWindow()
public static void registerWindow(Window w)
w - The window
public static void printException(LogUtil.LogCategory log_,
String xmsg,
Throwable exc)
log_ - The LogCatgory to log the error toxmsg - The error messageexc - The exception
public static void printException(LogUtil.LogCategory log_,
String xmsg,
Throwable exc,
byte[] fileBytes)
log_ - log categoryxmsg - messageexc - exceptionfileBytes - if non-null then write to a tmp file and tell
the user where to find it.
public static void printException(LogUtil.LogCategory log_,
String xmsg,
Throwable originalException,
File file)
log_ - log categoryxmsg - messageoriginalException - exceptionfile - If non-null then this is the tmp file that was written
Tell the user about it.
public static void printExceptionNoGui(LogUtil.LogCategory log_,
String xmsg,
Throwable exc)
log_ - The LogCategory to log the error toxmsg - The error messageexc - The exceptionpublic static void printMessage(String msg)
msg - public static void userMessage(String msg)
msg - The message
public static void userMessage(LogUtil.LogCategory log_,
String msg)
log_ - The category to log to. May be null.msg - The message
public static void userMessage(LogUtil.LogCategory log_,
String msg,
String consoleMsg)
log_ - The category to log to. May be null.msg - The messageconsoleMsg - What to show in the error console
public static void userMessage(LogUtil.LogCategory log_,
String msg,
boolean andLog)
log_ - The category to log to. May be null.msg - The messageandLog - Should we also log it to the log_
public static void userErrorMessage(LogUtil.LogCategory log_,
String msg)
log_ - category to log to (if not null).msg - The messagepublic static void userErrorMessage(String msg)
msg - The messagepublic static void userErrorMessage(Object msg)
msg - May be a String or a Componentpublic static void addMessageLogger(JTextArea t)
t - The text componentpublic static void addMessageLogger(JLabel t)
t - The text componentpublic static void removeMessageLogger(Object t)
t - The component to removepublic static void clearMessage(String message)
message - The message to clearpublic static void message(String msg)
msg - The message to showpublic static void tracePrintlns()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||