Package ghidra.app.util.importer
Class MessageLog
java.lang.Object
ghidra.app.util.importer.MessageLog
- Direct Known Subclasses:
XmlMessageLog
A simple class to handle logging messages and exceptions. A maximum message count size
constraint can be set to clip messages after a certain number, but still keep incrementing
a running total.
In addition to logging messages, clients can also set a status message. This message may later used as the primary error message when reporting to the user.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Appends the exception to the logvoid
Appends the message and line number to the logvoid
Appends the message to the logvoid
Appends the message to the logvoid
clear()
Clears all messages from this log and resets the countvoid
Clear status messagevoid
copyFrom
(MessageLog log) Copies the contents of one message log into this onevoid
Deprecated.Returns a stored status messageboolean
Returns true if this log has messagesvoid
Stores a status message that can be used elsewhere (i.e., populate warning dialogs)toString()
void
Writes this log's contents to the application log
-
Constructor Details
-
MessageLog
public MessageLog()
-
-
Method Details
-
copyFrom
Copies the contents of one message log into this one- Parameters:
log
- the log to copy from
-
appendMsg
Appends the message to the log- Parameters:
message
- the message
-
appendMsg
Appends the message to the log- Parameters:
originator
- the originator of the messagemessage
- the message
-
appendMsg
Appends the message and line number to the log- Parameters:
lineNum
- the line number that generated the messagemessage
- the message
-
appendException
Appends the exception to the log- Parameters:
t
- the exception to append to the log
-
error
Deprecated.Readable method for appending error messages to the log.Currently does nothing different than
appendMsg(String, String)
.- Parameters:
originator
- the originator of the messagemessage
- the message
-
hasMessages
public boolean hasMessages()Returns true if this log has messages- Returns:
- true if this log has messages
-
clear
public void clear()Clears all messages from this log and resets the count -
setStatus
Stores a status message that can be used elsewhere (i.e., populate warning dialogs)- Parameters:
status
- the status message
-
clearStatus
public void clearStatus()Clear status message -
getStatus
Returns a stored status message- Returns:
- stored status message
-
toString
-
write
Writes this log's contents to the application log- Parameters:
owner
- the owning class whose name will appear in the log messagemessageHeader
- the message header that will appear before the log messages
-
appendMsg(String)