Package ghidra.util
Class Msg
java.lang.Object
ghidra.util.Msg
Class with static methods to report errors as either a short message or a
more detailed message (e.g., stacktrace).
The 'message' parameter for these calls is typically a String. However, it can also
be a log4j Message
object as well. (See log4j2 for details.)
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Used to record a debug message to the log file.static void
Used to record a debug message to the log file.static void
Used to display an error message with no available Throwable to the user via the console (no GUI).static void
Used to display an error message with a Throwable (for stack trace) to the user via the console (no GUI).static void
Used to display an informational message to the user via the console (no GUI).static void
Used to display an informational message to the user via the console (no GUI).static void
Useful for printing temporary messages without any logging markup.static void
setErrorDisplay
(ErrorDisplay errDisplay) Sets the error display (by default it's console)static void
setErrorLogger
(ErrorLogger errLogger) Sets the error logger (by default it's a DefaultErrorLogger).static void
Used to display an error message with no available Throwable to the user with a pop-up GUI dialog.static void
Used to display an error message with a Throwable (for stack trace) to the user with a pop-up GUI dialog.static void
Used to display an informational message to the user with a pop-up GUI dialog.static void
Used to display a warning message to the user with a pop-up GUI dialog.static void
Used to record a trace message to the log file.static void
Used to record a trace message to the log file.static void
Used to display a warning message to the user via the console (no GUI).static void
Used to display a warning message to the user via the console (no GUI).
-
Method Details
-
setErrorLogger
Sets the error logger (by default it's a DefaultErrorLogger).- Parameters:
errLogger
- the error logger
-
setErrorDisplay
Sets the error display (by default it's console)- Parameters:
errDisplay
- the error display
-
out
Useful for printing temporary messages without any logging markup. This is meant to be a replacement for System.out.- Parameters:
message
- the message to print
-
trace
Used to record a trace message to the log file. All calls to this method outside of main methods and JUnit tests will be removed before a production release.- Parameters:
originator
- a Logger instance, "this", or YourClass.classmessage
- the details of the message
-
trace
Used to record a trace message to the log file. All calls to this method outside of main methods and JUnit tests will be removed before a production release. This may be used to document an exception without elevating that exception to error or warning status.- Parameters:
originator
- a Logger instance, "this", or YourClass.classmessage
- the details of the messagethrowable
- the Throwable that describes the cause of the error
-
debug
Used to record a debug message to the log file.- Parameters:
originator
- a Logger instance, "this", or YourClass.classmessage
- the details of the message
-
debug
Used to record a debug message to the log file. This may be used to document an exception without elevating that exception to error or warning status- Parameters:
originator
- a Logger instance, "this", or YourClass.classmessage
- the details of the messagethrowable
- the Throwable that describes the cause of the error
-
info
Used to display an informational message to the user via the console (no GUI). Also records the message to the logging system.- Parameters:
originator
- a Logger instance, "this", or YourClass.classmessage
- the details of the message
-
info
Used to display an informational message to the user via the console (no GUI). Also records the message to the logging system. This may be used to document an exception without elevating that exception to error or warning status.- Parameters:
originator
- a Logger instance, "this", or YourClass.classmessage
- the details of the messagethrowable
- the Throwable that describes the cause of the error
-
showInfo
Used to display an informational message to the user with a pop-up GUI dialog. Also records the message to the logging system.- Parameters:
originator
- a Logger instance, "this", or YourClass.classparent
- a parent component used to center the dialog (or null if you don't have one)title
- the title of the pop-up dialog (main subject of message)message
- the details of the message
-
warn
Used to display a warning message to the user via the console (no GUI). Also records the message to the logging system.- Parameters:
originator
- a Logger instance, "this", or YourClass.classmessage
- the details of the message
-
warn
Used to display a warning message to the user via the console (no GUI). Also records the message to the logging system.- Parameters:
originator
- a Logger instance, "this", or YourClass.classmessage
- the details of the messagethrowable
- a Throwable for printing a stack trace
-
showWarn
Used to display a warning message to the user with a pop-up GUI dialog. Also records the message to the logging system.- Parameters:
originator
- a Logger instance, "this", or YourClass.classparent
- a parent component used to center the dialog (or null if you don't have one)title
- the title of the pop-up dialog (main subject of message)message
- the details of the message
-
error
Used to display an error message with no available Throwable to the user via the console (no GUI). Also records the message to the logging system. If you have a Throwable, please use the other error(...) method.- Parameters:
originator
- a Logger instance, "this", or YourClass.classmessage
- the details of the message
-
error
Used to display an error message with a Throwable (for stack trace) to the user via the console (no GUI). Also records the message to the logging system.- Parameters:
originator
- a Logger instance, "this", or YourClass.classmessage
- the details of the messagethrowable
- the Throwable that describes the cause of the error
-
showError
Used to display an error message with no available Throwable to the user with a pop-up GUI dialog. Also records the message to the logging system. If you have a Throwable, please use the other error(...) method.- Parameters:
originator
- a Logger instance, "this", or YourClass.classparent
- a parent component used to center the dialog (or null if you don't have one)title
- the title of the pop-up dialog (main subject of message)message
- the details of the message
-
showError
public static void showError(Object originator, Component parent, String title, Object message, Throwable throwable) Used to display an error message with a Throwable (for stack trace) to the user with a pop-up GUI dialog. Also records the message to the logging system.- Parameters:
originator
- a Logger instance, "this", or YourClass.classparent
- a parent component used to center the dialog (or null if you don't have one)title
- the title of the pop-up dialog (main subject of message)message
- the details of the messagethrowable
- the Throwable that describes the cause of the error
-